Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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)
|