Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,18 +2,18 @@ import gradio as gr
|
|
2 |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, pipeline
|
3 |
|
4 |
# Load the model and tokenizer
|
5 |
-
model_name = 'IMISLab/
|
6 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
8 |
|
9 |
# Set up the summarizer pipeline
|
10 |
summarizer = pipeline(
|
11 |
'summarization',
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
max_new_tokens=
|
16 |
-
truncation=True
|
17 |
)
|
18 |
|
19 |
# Define the summarization function
|
|
|
2 |
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, pipeline
|
3 |
|
4 |
# Load the model and tokenizer
|
5 |
+
model_name = 'IMISLab/GreekT5-umt5-small-greeksum'
|
6 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
8 |
|
9 |
# Set up the summarizer pipeline
|
10 |
summarizer = pipeline(
|
11 |
'summarization',
|
12 |
+
device = 'cpu',
|
13 |
+
model = model,
|
14 |
+
tokenizer = tokenizer,
|
15 |
+
max_new_tokens = 128,
|
16 |
+
truncation = True
|
17 |
)
|
18 |
|
19 |
# Define the summarization function
|