Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -8,6 +8,9 @@ cp_aug = 'minnehwg/finetune-newwiki-summarization-ver-augmented'
8
  tokenizer = AutoTokenizer.from_pretrained("VietAI/vit5-base")
9
  model = AutoModelForSeq2SeqLM.from_pretrained(cp_aug)
10
 
 
 
 
11
 
12
 
13
  with gr.Blocks() as demo:
@@ -16,6 +19,6 @@ with gr.Blocks() as demo:
16
  inp = gr.Textbox(placeholder="What is your name?")
17
  out = gr.Textbox()
18
  btn = gr.Button("Run")
19
- btn.click(fn=summarize, inputs=inp, outputs=out)
20
 
21
  demo.launch()
 
8
  tokenizer = AutoTokenizer.from_pretrained("VietAI/vit5-base")
9
  model = AutoModelForSeq2SeqLM.from_pretrained(cp_aug)
10
 
11
+ def summarize_text(text):
12
+ text = summarize(text, model, tokenizer, 4)
13
+ return text
14
 
15
 
16
  with gr.Blocks() as demo:
 
19
  inp = gr.Textbox(placeholder="What is your name?")
20
  out = gr.Textbox()
21
  btn = gr.Button("Run")
22
+ btn.click(fn=summarize_text, inputs=inp, outputs=out)
23
 
24
  demo.launch()