richylyq commited on
Commit
90e8b1d
·
1 Parent(s): 8c5885d

change the way page is coded

Browse files
Files changed (1) hide show
  1. app.py +5 -10
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
- translate = gr.Interface(
117
- opus_trans,
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()