Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,8 @@ import gradio as gr
|
|
3 |
from transformers import pipeline
|
4 |
|
5 |
# Use a pipeline as a high-level helper
|
6 |
-
|
|
|
7 |
|
8 |
def summary(input):
|
9 |
output = text_summary(input)
|
|
|
3 |
from transformers import pipeline
|
4 |
|
5 |
# Use a pipeline as a high-level helper
|
6 |
+
device = 0 if torch.cuda.is_available() else -1
|
7 |
+
text_summary = pipeline("summarization", model="Falconsai/text_summarization",device=device,torch_dtype=torch.bfloat16)
|
8 |
|
9 |
def summary(input):
|
10 |
output = text_summary(input)
|