Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
|
3 |
|
4 |
-
|
5 |
|
6 |
-
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
pipe = pipeline(task="text2text-generation", model = "human-centered-summarization/financial-summarization-pegasus")
|
13 |
|
14 |
with open('text1.txt') as f:
|
15 |
text1 = f.read()
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
|
3 |
|
4 |
+
tokenizer = AutoTokenizer.from_pretrained("human-centered-summarization/financial-summarization-pegasus")
|
5 |
|
6 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("human-centered-summarization/financial-summarization-pegasus")
|
7 |
|
8 |
+
pipe = pipeline(task="summarization",
|
9 |
+
model=model,
|
10 |
+
tokenizer=tokenizer,)
|
|
|
|
|
11 |
|
12 |
with open('text1.txt') as f:
|
13 |
text1 = f.read()
|