crang commited on
Commit
e433261
·
verified ·
1 Parent(s): 40bac30

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1,6 +1,8 @@
1
  import gradio as gr
 
2
  from transformers import pipeline
3
 
 
4
  def analyze_sentiment(text):
5
  classifier = pipeline("sentiment-analysis", model="distilbert-base-uncased-finetuned-sst-2-english")
6
  result = classifier(text)
 
1
  import gradio as gr
2
+ import spaces
3
  from transformers import pipeline
4
 
5
+ @spaces.GPU(duration=150)
6
  def analyze_sentiment(text):
7
  classifier = pipeline("sentiment-analysis", model="distilbert-base-uncased-finetuned-sst-2-english")
8
  result = classifier(text)