import gradio as gr def cged_correction(sentence): return sentence with gr.Blocks() as demo: #設定輸入元件 sent = gr.Textbox(label="Sentence") # 設定輸出元件 output = gr.Textbox(label="Result") #設定按鈕 greet_btn = gr.Button("Correction") #設定按鈕點選事件 greet_btn.click(fn=cged_correction, inputs=name, outputs=output) demo.launch()