Ashish Soni commited on
Commit
359bc68
·
verified ·
1 Parent(s): 5f0c9a6

Update app.py

Browse files

upgrade hardware to GPU using Zero GPU Spaces

Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1,8 +1,10 @@
1
  import gradio as gr
 
2
  from transformers import pipeline
3
 
4
  get_completion = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6")
5
 
 
6
  def summarize(input):
7
  output = get_completion(input)
8
  return output[0]['summary_text']
 
1
  import gradio as gr
2
+ import spaces
3
  from transformers import pipeline
4
 
5
  get_completion = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6")
6
 
7
+ @spaces.GPU(duration=120)
8
  def summarize(input):
9
  output = get_completion(input)
10
  return output[0]['summary_text']