Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ pegasus_tokenizer = PegasusTokenizer.from_pretrained(model_name)
|
|
8 |
def summarize(input_text):
|
9 |
nwords=len(input_text.split(" "))
|
10 |
# Define summarization pipeline
|
11 |
-
summarizer = pipeline("summarization", model=model_name, tokenizer=pegasus_tokenizer,min_length=int(nwords/10)+
|
12 |
summary=summarizer(input_text)[0]['summary_text']
|
13 |
return(summary)
|
14 |
gr.Interface(fn=summarize,inputs=gr.inputs.Textbox(placeholder="Paste the text to be summarized here..."),outputs="textbox").launch();
|
|
|
8 |
def summarize(input_text):
|
9 |
nwords=len(input_text.split(" "))
|
10 |
# Define summarization pipeline
|
11 |
+
summarizer = pipeline("summarization", model=model_name, tokenizer=pegasus_tokenizer,min_length=int(nwords/10)+10, max_length=int(nwords/5+10), framework="pt")
|
12 |
summary=summarizer(input_text)[0]['summary_text']
|
13 |
return(summary)
|
14 |
gr.Interface(fn=summarize,inputs=gr.inputs.Textbox(placeholder="Paste the text to be summarized here..."),outputs="textbox").launch();
|