Spaces:
Sleeping
Sleeping
change device to cpu
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ from transformers import pipeline
|
|
3 |
|
4 |
|
5 |
def sentiment_analysis(text:str)->str:
|
6 |
-
analysis_tools = pipeline("text-classification", model = "boltuix/bert-emotion",device=
|
7 |
result = analysis_tools(text)
|
8 |
|
9 |
return f"the label: {result[0]['label']} and the score: {result[0]['score']}"
|
|
|
3 |
|
4 |
|
5 |
def sentiment_analysis(text:str)->str:
|
6 |
+
analysis_tools = pipeline("text-classification", model = "boltuix/bert-emotion",device=0)
|
7 |
result = analysis_tools(text)
|
8 |
|
9 |
return f"the label: {result[0]['label']} and the score: {result[0]['score']}"
|