Demosthene-OR commited on
Commit
63bce98
1 Parent(s): 3d3eec2

Update modelisation_seq2seq_tab.py

Browse files
Files changed (1) hide show
  1. tabs/modelisation_seq2seq_tab.py +4 -1
tabs/modelisation_seq2seq_tab.py CHANGED
@@ -89,7 +89,10 @@ def display_translation(n1, Lang,model_type):
89
  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>", \
90
  unsafe_allow_html=True)
91
  '''
 
 
92
 
 
93
  def display_translation(n1, Lang,model_type):
94
  global df_data_src, df_data_tgt, placeholder
95
 
@@ -112,7 +115,7 @@ def display_translation(n1, Lang,model_type):
112
  params.append(url+"?lang_tgt="+target+"&texte="+s[i])
113
 
114
  with Pool(3) as p:
115
- responses = p.map(requests.get, params)
116
 
117
  for i in range(3):
118
  s_trad.append(responses[i].json())
 
89
  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>", \
90
  unsafe_allow_html=True)
91
  '''
92
+ async def fetch_translation(param):
93
+ return await requests.get(param)
94
 
95
+
96
  def display_translation(n1, Lang,model_type):
97
  global df_data_src, df_data_tgt, placeholder
98
 
 
115
  params.append(url+"?lang_tgt="+target+"&texte="+s[i])
116
 
117
  with Pool(3) as p:
118
+ responses = p.map(fetch_translation, params)
119
 
120
  for i in range(3):
121
  s_trad.append(responses[i].json())