Demosthene-OR
commited on
Commit
•
92e4a13
1
Parent(s):
4eea31c
Update modelisation_seq2seq_tab.py
Browse files
tabs/modelisation_seq2seq_tab.py
CHANGED
@@ -275,7 +275,7 @@ n1 = 0
|
|
275 |
df_data_en, df_data_fr, translation_en_fr, translation_fr_en, lang_classifier, model_speech, rnn_en_fr, rnn_fr_en,\
|
276 |
transformer_en_fr, transformer_fr_en, finetuned_translation_en_fr = load_all_data()
|
277 |
|
278 |
-
|
279 |
def display_translation(n1, Lang,model_type):
|
280 |
global df_data_src, df_data_tgt, placeholder
|
281 |
|
@@ -305,8 +305,8 @@ def display_translation(n1, Lang,model_type):
|
|
305 |
with placeholder:
|
306 |
st.write("<p style='text-align:center;background-color:red; color:white')>Score Bleu = "+str(int(round(corpus_bleu(s_trad,[s_trad_ref]).score,0)))+"%</p>", \
|
307 |
unsafe_allow_html=True)
|
308 |
-
|
309 |
'''
|
|
|
310 |
async def fetch_translation(url, params):
|
311 |
a = str(time.time())
|
312 |
st.write("debut fetch: "+a)
|
@@ -351,7 +351,7 @@ async def display_translation(n1, Lang, model_type):
|
|
351 |
with placeholder:
|
352 |
st.write("<p style='text-align:center;background-color:red; color:white')>Score Bleu = "+str(int(round(corpus_bleu(s_trad,[s_trad_ref]).score,0)))+"%</p>", \
|
353 |
unsafe_allow_html=True)
|
354 |
-
|
355 |
|
356 |
|
357 |
@st.cache_data
|
@@ -457,15 +457,15 @@ def run():
|
|
457 |
if (chosen_id == "tab1"):
|
458 |
t0 = time.time()
|
459 |
# Exécuter la fonction asynchrone
|
460 |
-
|
461 |
-
display_translation(n1, Lang,1)
|
462 |
t1 = time.time()
|
463 |
st.write("Durée: "+str(t1-t0))
|
464 |
else:
|
465 |
t0 = time.time()
|
466 |
# Exécuter la fonction asynchrone
|
467 |
-
|
468 |
-
display_translation(n1, Lang,2)
|
469 |
t1 = time.time()
|
470 |
st.write("Durée: "+str(t1-t0))
|
471 |
|
|
|
275 |
df_data_en, df_data_fr, translation_en_fr, translation_fr_en, lang_classifier, model_speech, rnn_en_fr, rnn_fr_en,\
|
276 |
transformer_en_fr, transformer_fr_en, finetuned_translation_en_fr = load_all_data()
|
277 |
|
278 |
+
'''
|
279 |
def display_translation(n1, Lang,model_type):
|
280 |
global df_data_src, df_data_tgt, placeholder
|
281 |
|
|
|
305 |
with placeholder:
|
306 |
st.write("<p style='text-align:center;background-color:red; color:white')>Score Bleu = "+str(int(round(corpus_bleu(s_trad,[s_trad_ref]).score,0)))+"%</p>", \
|
307 |
unsafe_allow_html=True)
|
|
|
308 |
'''
|
309 |
+
|
310 |
async def fetch_translation(url, params):
|
311 |
a = str(time.time())
|
312 |
st.write("debut fetch: "+a)
|
|
|
351 |
with placeholder:
|
352 |
st.write("<p style='text-align:center;background-color:red; color:white')>Score Bleu = "+str(int(round(corpus_bleu(s_trad,[s_trad_ref]).score,0)))+"%</p>", \
|
353 |
unsafe_allow_html=True)
|
354 |
+
|
355 |
|
356 |
|
357 |
@st.cache_data
|
|
|
457 |
if (chosen_id == "tab1"):
|
458 |
t0 = time.time()
|
459 |
# Exécuter la fonction asynchrone
|
460 |
+
asyncio.run(display_translation(n1, Lang, 1))
|
461 |
+
# display_translation(n1, Lang,1)
|
462 |
t1 = time.time()
|
463 |
st.write("Durée: "+str(t1-t0))
|
464 |
else:
|
465 |
t0 = time.time()
|
466 |
# Exécuter la fonction asynchrone
|
467 |
+
asyncio.run(display_translation(n1, Lang, 2))
|
468 |
+
# display_translation(n1, Lang,2)
|
469 |
t1 = time.time()
|
470 |
st.write("Durée: "+str(t1-t0))
|
471 |
|