Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,15 +2,13 @@ import torch
|
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
4 |
|
5 |
-
|
6 |
-
de_text_summary = pipeline("summarization", model="Shahm/bart-german")
|
7 |
-
#de_text_summary= pipeline("summarization", model="Joemgu/mlong-t5-large-sumstew")
|
8 |
|
9 |
def summary (input):
|
10 |
max_length = 1024 # adjust this value as needed
|
11 |
if len(input) > max_length:
|
12 |
input = input[:max_length]
|
13 |
-
output =
|
14 |
return output[0]['summary_text']
|
15 |
|
16 |
gr.close_all()
|
|
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
4 |
|
5 |
+
text_summary = pipeline("summarization", model="Falconsai/text_summarization", torch_dtype=torch.bfloat16)
|
|
|
|
|
6 |
|
7 |
def summary (input):
|
8 |
max_length = 1024 # adjust this value as needed
|
9 |
if len(input) > max_length:
|
10 |
input = input[:max_length]
|
11 |
+
output = text_summary(input)
|
12 |
return output[0]['summary_text']
|
13 |
|
14 |
gr.close_all()
|