alex-abb commited on
Commit
cf4674b
1 Parent(s): 62f2a72

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -1,9 +1,12 @@
1
  import gradio as gr
2
  from transformers import pipeline
 
3
 
4
  # Charger le pipeline de classification des sentiments
5
  sentiment_analyzer = pipeline("sentiment-analysis", model="distilbert-base-uncased-finetuned-sst-2-english")
6
 
 
 
7
  def analyze_sentiment(text):
8
  # Analyser le sentiment du texte
9
  result = sentiment_analyzer(text)
 
1
  import gradio as gr
2
  from transformers import pipeline
3
+ import spaces
4
 
5
  # Charger le pipeline de classification des sentiments
6
  sentiment_analyzer = pipeline("sentiment-analysis", model="distilbert-base-uncased-finetuned-sst-2-english")
7
 
8
+ @spaces.GPU
9
+
10
  def analyze_sentiment(text):
11
  # Analyser le sentiment du texte
12
  result = sentiment_analyzer(text)