alecinvan commited on
Commit
8a1dfef
1 Parent(s): dc1b3c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -1
app.py CHANGED
@@ -169,6 +169,17 @@ def main():
169
  with gr.Row():
170
  gr.Markdown("### Step 01: 文本抽取")
171
 
 
 
 
 
 
 
 
 
 
 
 
172
  with gr.Row():
173
  with gr.Column():
174
  with gr.Row():
@@ -229,9 +240,14 @@ def main():
229
  outputs_text,])
230
  clear_img_btn.click(fn=clear_content, inputs=[], outputs=[inputs_img])
231
 
 
 
 
 
232
 
 
233
  # ---------------------- Summarization ----------------------
234
- # To update the click event of the button, use generate_summary directly
235
  generate_summary_btn.click(fn=generate_summary, inputs=[outputs_text],
236
  outputs=[outputs_summary_text])
237
  clear_summary_btn.click(fn=clear_content, inputs=[], outputs=[outputs_summary_text])
 
169
  with gr.Row():
170
  gr.Markdown("### Step 01: 文本抽取")
171
 
172
+ # Add a text box for direct input of text
173
+ with gr.Row():
174
+ inputs_direct_text = gr.Textbox(label="直接输入文本", lines=5)
175
+
176
+ with gr.Row():
177
+ with gr.Row():
178
+ # Button to generate summary from directly input text
179
+ generate_direct_summary_btn = gr.Button('生成概要', variant="primary")
180
+ with gr.Row():
181
+ clear_direct_summary_btn = gr.Button('清除概要')
182
+
183
  with gr.Row():
184
  with gr.Column():
185
  with gr.Row():
 
240
  outputs_text,])
241
  clear_img_btn.click(fn=clear_content, inputs=[], outputs=[inputs_img])
242
 
243
+ # ---------------------- Direct Text Summarization ----------------------
244
+ generate_direct_summary_btn.click(fn=generate_summary, inputs=[inputs_direct_text],
245
+ outputs=[outputs_summary_text])
246
+ clear_direct_summary_btn.click(fn=clear_content, inputs=[], outputs=[inputs_direct_text, outputs_summary_text])
247
 
248
+
249
  # ---------------------- Summarization ----------------------
250
+ # To update the click event of the button, use generate_summary directly
251
  generate_summary_btn.click(fn=generate_summary, inputs=[outputs_text],
252
  outputs=[outputs_summary_text])
253
  clear_summary_btn.click(fn=clear_content, inputs=[], outputs=[outputs_summary_text])