Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
from transformers import PegasusForConditionalGeneration
|
3 |
from tokenizers_pegasus import PegasusTokenizer
|
4 |
|
5 |
-
def summary(
|
6 |
model = PegasusForConditionalGeneration.from_pretrained("IDEA-CCNL/Randeng-Pegasus-238M-Summary-Chinese")
|
7 |
tokenizer = PegasusTokenizer.from_pretrained("IDEA-CCNL/Randeng-Pegasus-238M-Summary-Chinese")
|
8 |
inputs = tokenizer(text, max_length=1024, return_tensors="pt")
|
|
|
2 |
from transformers import PegasusForConditionalGeneration
|
3 |
from tokenizers_pegasus import PegasusTokenizer
|
4 |
|
5 |
+
def summary(text):
|
6 |
model = PegasusForConditionalGeneration.from_pretrained("IDEA-CCNL/Randeng-Pegasus-238M-Summary-Chinese")
|
7 |
tokenizer = PegasusTokenizer.from_pretrained("IDEA-CCNL/Randeng-Pegasus-238M-Summary-Chinese")
|
8 |
inputs = tokenizer(text, max_length=1024, return_tensors="pt")
|