Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
from util import update
|
|
|
3 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, DataCollatorForSeq2Seq, Seq2SeqTrainer, TrainingArguments
|
4 |
|
5 |
cp_aug = 'minnehwg/finetune-newwiki-summarization-ver-augmented'
|
@@ -7,12 +8,14 @@ cp_aug = 'minnehwg/finetune-newwiki-summarization-ver-augmented'
|
|
7 |
tokenizer = AutoTokenizer.from_pretrained("VietAI/vit5-base")
|
8 |
model = AutoModelForSeq2SeqLM.from_pretrained(cp_aug)
|
9 |
|
|
|
|
|
10 |
with gr.Blocks() as demo:
|
11 |
gr.Markdown("Start typing below and then click **Run** to see the output.")
|
12 |
with gr.Row():
|
13 |
inp = gr.Textbox(placeholder="What is your name?")
|
14 |
out = gr.Textbox()
|
15 |
btn = gr.Button("Run")
|
16 |
-
btn.click(fn=
|
17 |
|
18 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
from util import update
|
3 |
+
from util import summarize
|
4 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, DataCollatorForSeq2Seq, Seq2SeqTrainer, TrainingArguments
|
5 |
|
6 |
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:
|
14 |
gr.Markdown("Start typing below and then click **Run** to see the output.")
|
15 |
with gr.Row():
|
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()
|