Imane Momayiz
commited on
Commit
·
ada0440
1
Parent(s):
100b4b0
fix: submission to hf data
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ def fetch_sentence(dataset, column_name="darija_ar"):
|
|
28 |
|
29 |
return random_sentence
|
30 |
|
31 |
-
def store_submission(sentence: str, translation: str, translation_fr: str):
|
32 |
|
33 |
if sentence and (translation or translation_fr):
|
34 |
|
@@ -120,9 +120,11 @@ def main():
|
|
120 |
st.warning("Please enter a translation before submitting.")
|
121 |
else:
|
122 |
with st.spinner("Submitting translation..."):
|
123 |
-
store_submission(
|
|
|
124 |
st.session_state.translation_input,
|
125 |
-
st.session_state.translation_input_fr
|
|
|
126 |
|
127 |
if __name__ == "__main__":
|
128 |
main()
|
|
|
28 |
|
29 |
return random_sentence
|
30 |
|
31 |
+
def store_submission(api: HfApi, sentence: str, translation: str, translation_fr: str):
|
32 |
|
33 |
if sentence and (translation or translation_fr):
|
34 |
|
|
|
120 |
st.warning("Please enter a translation before submitting.")
|
121 |
else:
|
122 |
with st.spinner("Submitting translation..."):
|
123 |
+
store_submission(api,
|
124 |
+
st.session_state.sentence,
|
125 |
st.session_state.translation_input,
|
126 |
+
st.session_state.translation_input_fr
|
127 |
+
)
|
128 |
|
129 |
if __name__ == "__main__":
|
130 |
main()
|