minnehwg commited on
Commit
3287afb
·
verified ·
1 Parent(s): 6e45a28

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -10
app.py CHANGED
@@ -12,16 +12,24 @@ def get_model():
12
 
13
  tokenizer, model = get_model()
14
 
15
- def generate_summary(input_text):
16
- return pipeline(input_text)
17
-
18
- demo = gr.Interface(
19
- fn=generate_summary,
20
- inputs=gr.Textbox(lines=2, placeholder="Enter your URL..."),
21
- outputs=gr.Textbox(label="Generated Text"),
22
- title="Chào mừng đến với hệ thống tóm tắt của Minne >.<",
23
- description="Enter the URL to summarize and click 'Submit' to generate the summary."
24
- )
 
 
 
 
 
 
 
 
25
 
26
  demo.launch()
27
 
 
12
 
13
  tokenizer, model = get_model()
14
 
15
+ # demo = gr.Interface(
16
+ # fn=generate_summary,
17
+ # inputs=gr.Textbox(lines=2, placeholder="Enter your URL..."),
18
+ # outputs=gr.Textbox(label="Generated Text"),
19
+ # title="Chào mừng đến với hệ thống tóm tắt của Minne >.<",
20
+ # description="Enter the URL to summarize and click 'Submit' to generate the summary."
21
+ # )
22
+
23
+ def generate(text):
24
+ return pipeline(text, )
25
+
26
+ with gr.Blocks() as demo:
27
+ gr.Markdown("Start typing below and then click **Run** to see the output.")
28
+ with gr.Row():
29
+ inp = gr.Textbox(placeholder="Enter your URL")
30
+ out = gr.Textbox()
31
+ btn = gr.Button("Run")
32
+ btn.click(fn=generate, inputs=inp, outputs=out)
33
 
34
  demo.launch()
35