Imane Momayiz commited on
Commit
ba08cc7
·
1 Parent(s): ada0440

fix: new sentence

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -13,7 +13,6 @@ api = HfApi(token=HF_API_KEY)
13
 
14
  REPO_ID = "imomayiz/darija-english"
15
  DATASET_REPO_URL = f"https://huggingface.co/datasets/{REPO_ID}"
16
- SUBMISSIONS_DATA_FILE = os.path.join("submissions", "submissions.csv")
17
 
18
 
19
  def load_data(repo_id):
@@ -56,6 +55,8 @@ def store_submission(api: HfApi, sentence: str, translation: str, translation_fr
56
  # Load the dataset
57
  dataset = load_data(REPO_ID)
58
 
 
 
59
 
60
  def main():
61
 
@@ -92,8 +93,7 @@ def main():
92
 
93
  # Display new sentence button
94
  st.session_state.display_new = st.button("New Sentence",
95
- on_click=fetch_sentence,
96
- args=(dataset,))
97
 
98
 
99
  # Input field for translation
 
13
 
14
  REPO_ID = "imomayiz/darija-english"
15
  DATASET_REPO_URL = f"https://huggingface.co/datasets/{REPO_ID}"
 
16
 
17
 
18
  def load_data(repo_id):
 
55
  # Load the dataset
56
  dataset = load_data(REPO_ID)
57
 
58
+ def generate_new_sentence():
59
+ return fetch_sentence(dataset)
60
 
61
  def main():
62
 
 
93
 
94
  # Display new sentence button
95
  st.session_state.display_new = st.button("New Sentence",
96
+ on_click=generate_new_sentence,)
 
97
 
98
 
99
  # Input field for translation