richylyq commited on
Commit
65fbb2d
·
1 Parent(s): a4c05d6

updates for dropdown list

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -142,12 +142,12 @@ with gr.Blocks(theme=myTheme) as demo:
142
  toolkit_select = gr.Dropdown(["OPUS", "NLLB"], label="Select Translation Model")
143
  lang_select = gr.Radio(["English", "Chinese"], label="Select Desired Language")
144
  result = gr.Textbox(label="Translated Result")
145
-
146
- toolkit_select.select(on_select)
147
  # trans_btn.click(fn=opus_trans, inputs=[article, lang_select], outputs=result)
148
  if toolkit_select.select(on_select) == "OPUS":
149
  print(" chosen OPUS")
150
- trans_btn = gr.Button("Translate")
151
  trans_btn.click(fn=opus_trans, inputs=[article, lang_select], outputs=result)
152
  elif toolkit_select.select(on_select) == "NLLB":
153
  print(" chosen NLLB")
 
142
  toolkit_select = gr.Dropdown(["OPUS", "NLLB"], label="Select Translation Model")
143
  lang_select = gr.Radio(["English", "Chinese"], label="Select Desired Language")
144
  result = gr.Textbox(label="Translated Result")
145
+ trans_btn = gr.Button("Translate")
146
+ print(toolkit_select.select(on_select))
147
  # trans_btn.click(fn=opus_trans, inputs=[article, lang_select], outputs=result)
148
  if toolkit_select.select(on_select) == "OPUS":
149
  print(" chosen OPUS")
150
+
151
  trans_btn.click(fn=opus_trans, inputs=[article, lang_select], outputs=result)
152
  elif toolkit_select.select(on_select) == "NLLB":
153
  print(" chosen NLLB")