change the way page is coded
Browse files
app.py
CHANGED
@@ -111,15 +111,10 @@ def opus_trans(article, target_language):
|
|
111 |
myTheme = myTheme()
|
112 |
|
113 |
with gr.Blocks(theme=myTheme) as demo:
|
114 |
-
article = gr.Textbox()
|
115 |
-
lang_select = gr.Radio(["English", "Chinese"])
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
article,
|
120 |
-
lang_select,
|
121 |
-
],
|
122 |
-
outputs=gr.Textbox(),
|
123 |
-
)
|
124 |
|
125 |
demo.launch()
|
|
|
111 |
myTheme = myTheme()
|
112 |
|
113 |
with gr.Blocks(theme=myTheme) as demo:
|
114 |
+
article = gr.Textbox(label="Article")
|
115 |
+
lang_select = gr.Radio(["English", "Chinese"], label="Select Desired Language")
|
116 |
+
result = gr.Textbox(label="Translated Result")
|
117 |
+
trans_btn = gr.Button("Translate")
|
118 |
+
trans_btn.click(fn=opus_trans, inputs=article, outputs=result)
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
demo.launch()
|