Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,16 +3,15 @@ import torch
|
|
3 |
import gradio as gr
|
4 |
|
5 |
summarizer = pipeline(task="summarization",
|
6 |
-
model="
|
7 |
torch_dtype=torch.bfloat16)
|
8 |
|
9 |
|
10 |
|
11 |
# name of the function
|
12 |
def summary(text):
|
13 |
-
|
14 |
-
|
15 |
-
max_length=100)
|
16 |
|
17 |
|
18 |
demo = gr.Interface(fn=summary, inputs="text", outputs="text")
|
|
|
3 |
import gradio as gr
|
4 |
|
5 |
summarizer = pipeline(task="summarization",
|
6 |
+
model="facebook/bart-large-cnn",
|
7 |
torch_dtype=torch.bfloat16)
|
8 |
|
9 |
|
10 |
|
11 |
# name of the function
|
12 |
def summary(text):
|
13 |
+
summary = summarizer(text,min_length=10,max_length=100)
|
14 |
+
return summary
|
|
|
15 |
|
16 |
|
17 |
demo = gr.Interface(fn=summary, inputs="text", outputs="text")
|