Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import pipeline
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
7 |
gr.Interface.from_pipeline(pipe,
|
8 |
-
title="
|
9 |
-
description="
|
10 |
allow_flagging="never").launch(inbrowser=True)
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM
|
3 |
|
4 |
+
tokenizer = AutoTokenizer.from_pretrained("google/pegasus-xsum")
|
5 |
+
|
6 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("google/pegasus-xsum")
|
7 |
+
|
8 |
+
pipe = pipeline(task="summarization",
|
9 |
+
model=model,
|
10 |
+
tokenizer=tokenizer)
|
11 |
gr.Interface.from_pipeline(pipe,
|
12 |
+
title="Summarization using pegasus",
|
13 |
+
description="Summarization description",
|
14 |
allow_flagging="never").launch(inbrowser=True)
|