TedYeh commited on
Commit
0cbca3d
1 Parent(s): 23ea43b

update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -1,7 +1,14 @@
1
  import gradio as gr
2
-
3
  def cged_correction(sentence):
4
  return sentence
5
 
6
- iface = gr.Interface(fn=cged_correction, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
 
2
  def cged_correction(sentence):
3
  return sentence
4
 
5
+ with gr.Blocks() as demo:
6
+ #設定輸入元件
7
+ sent = gr.Textbox(label="Sentence")
8
+ # 設定輸出元件
9
+ output = gr.Textbox(label="Result")
10
+ #設定按鈕
11
+ greet_btn = gr.Button("Correction")
12
+ #設定按鈕點選事件
13
+ greet_btn.click(fn=cged_correction, inputs=name, outputs=output)
14
+ demo.launch()