Demosthene-OR commited on
Commit
d809064
·
1 Parent(s): b65fa3b

Update main_dl.py

Browse files
Files changed (1) hide show
  1. main_dl.py +3 -3
main_dl.py CHANGED
@@ -241,14 +241,14 @@ rnn_en_fr, rnn_fr_en, transformer_en_fr, transformer_fr_en = load_all_data()
241
  async def display_translation(n1, Lang,model_type):
242
  global df_data_src, df_data_tgt, placeholder
243
 
244
- async def decode_seq_all(model_type,s,):
245
  for i in range(3):
246
  if model_type==1:
247
  s_trad.append(decode_sequence_rnn(s[i], source, target))
248
  else:
249
  s_trad.append(decode_sequence_tranf(s[i], source, target))
250
  await (len(s_trad) == 3)
251
- return
252
 
253
  placeholder = st.empty()
254
  with st.status(":sunglasses:", expanded=True):
@@ -257,7 +257,7 @@ async def display_translation(n1, Lang,model_type):
257
  s_trad_ref = df_data_tgt.iloc[n1:n1+5][0].tolist()
258
  source = Lang[:2]
259
  target = Lang[-2:]
260
- await decode_seq_all()
261
  for i in range(3):
262
  st.write("**"+source+" :** :blue["+ s[i]+"]")
263
  st.write("**"+target+" :** "+s_trad[-1])
 
241
  async def display_translation(n1, Lang,model_type):
242
  global df_data_src, df_data_tgt, placeholder
243
 
244
+ async def decode_seq_all(model_type,s, source, target):
245
  for i in range(3):
246
  if model_type==1:
247
  s_trad.append(decode_sequence_rnn(s[i], source, target))
248
  else:
249
  s_trad.append(decode_sequence_tranf(s[i], source, target))
250
  await (len(s_trad) == 3)
251
+ return s_trad
252
 
253
  placeholder = st.empty()
254
  with st.status(":sunglasses:", expanded=True):
 
257
  s_trad_ref = df_data_tgt.iloc[n1:n1+5][0].tolist()
258
  source = Lang[:2]
259
  target = Lang[-2:]
260
+ await decode_seq_all(model_type,s, source, target)
261
  for i in range(3):
262
  st.write("**"+source+" :** :blue["+ s[i]+"]")
263
  st.write("**"+target+" :** "+s_trad[-1])