pavishnikarthikeyan commited on
Commit
a6eeda1
·
verified ·
1 Parent(s): de8dfd6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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
- text_summary = pipeline("summarization", model="Falconsai/text_summarization",torch_dtype=torch.bfloat16)
 
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)