updates for dropdown list
Browse files
app.py
CHANGED
@@ -78,6 +78,7 @@ class myTheme(Base):
|
|
78 |
|
79 |
|
80 |
def on_select(evt: gr.SelectData): # SelectData is a subclass of EventData
|
|
|
81 |
return evt.value
|
82 |
|
83 |
|
@@ -143,6 +144,8 @@ with gr.Blocks(theme=myTheme) as demo:
|
|
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 |
if toolkit_select.select(on_select) == "OPUS":
|
147 |
trans_btn.click(fn=opus_trans, inputs=[article, lang_select], outputs=result)
|
148 |
elif toolkit_select.select(on_select) == "NLLB":
|
|
|
78 |
|
79 |
|
80 |
def on_select(evt: gr.SelectData): # SelectData is a subclass of EventData
|
81 |
+
print(evt.value)
|
82 |
return evt.value
|
83 |
|
84 |
|
|
|
144 |
lang_select = gr.Radio(["English", "Chinese"], label="Select Desired Language")
|
145 |
result = gr.Textbox(label="Translated Result")
|
146 |
trans_btn = gr.Button("Translate")
|
147 |
+
toolkit_select.select(on_select)
|
148 |
+
trans_btn.click(fn=opus_trans, inputs=[article, lang_select], outputs=result)
|
149 |
if toolkit_select.select(on_select) == "OPUS":
|
150 |
trans_btn.click(fn=opus_trans, inputs=[article, lang_select], outputs=result)
|
151 |
elif toolkit_select.select(on_select) == "NLLB":
|