Update app.py
Browse files
app.py
CHANGED
@@ -114,7 +114,7 @@ with gr.Blocks() as demo:
|
|
114 |
with gr.Row():
|
115 |
with gr.Column():
|
116 |
btn = gr.Button("隨機選擇")
|
117 |
-
btn4 = gr.ClearButton(value="清除標註內容",[result, element, tag])
|
118 |
with gr.Row():
|
119 |
element = gr.components.Textbox(lines=2, label="構成要件要素")
|
120 |
tag = gr.Dropdown(choices = [("被告(犯罪主體)","<LEO_SOC>"), ("主觀犯意", "<LEO_SLE>"), ("不法行為","<LEO_ACT>"), ("因果關係","<LEO_CAU>"),
|
@@ -132,7 +132,7 @@ with gr.Blocks() as demo:
|
|
132 |
btn.click(random_next, inputs=[], outputs=[courtName, caseNo, prompt, filename])
|
133 |
btn2.click(gen_template, inputs=[prompt, element, tag], outputs=[result])
|
134 |
btn3.click(None, inputs=[result, filename], _js=js_download)
|
135 |
-
btn4.click(None, [result, element, tag])
|
136 |
|
137 |
if __name__ == "__main__":
|
138 |
demo.launch() # 在遠端啟動時,需要 share=True 。
|
|
|
114 |
with gr.Row():
|
115 |
with gr.Column():
|
116 |
btn = gr.Button("隨機選擇")
|
117 |
+
btn4 = gr.ClearButton(value="清除標註內容",components=[result, element, tag])
|
118 |
with gr.Row():
|
119 |
element = gr.components.Textbox(lines=2, label="構成要件要素")
|
120 |
tag = gr.Dropdown(choices = [("被告(犯罪主體)","<LEO_SOC>"), ("主觀犯意", "<LEO_SLE>"), ("不法行為","<LEO_ACT>"), ("因果關係","<LEO_CAU>"),
|
|
|
132 |
btn.click(random_next, inputs=[], outputs=[courtName, caseNo, prompt, filename])
|
133 |
btn2.click(gen_template, inputs=[prompt, element, tag], outputs=[result])
|
134 |
btn3.click(None, inputs=[result, filename], _js=js_download)
|
135 |
+
btn4.click(None, components=[result, element, tag])
|
136 |
|
137 |
if __name__ == "__main__":
|
138 |
demo.launch() # 在遠端啟動時,需要 share=True 。
|