Spaces:
Runtime error
Runtime error
Update HebEMO.py
Browse files
HebEMO.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
class HebEMO:
|
| 2 |
-
def __init__(self, device
|
| 3 |
'sadness', 'disgust']):
|
| 4 |
|
| 5 |
from transformers import pipeline
|
|
@@ -14,7 +14,7 @@ class HebEMO:
|
|
| 14 |
"sentiment-analysis",
|
| 15 |
model="avichr/hebEMO_"+emo,
|
| 16 |
tokenizer="avichr/heBERT",
|
| 17 |
-
device = self.device
|
| 18 |
)
|
| 19 |
|
| 20 |
|
|
|
|
| 1 |
class HebEMO:
|
| 2 |
+
def __init__(self, device=-1, emotions = ['anticipation', 'joy', 'trust', 'fear', 'surprise', 'anger',
|
| 3 |
'sadness', 'disgust']):
|
| 4 |
|
| 5 |
from transformers import pipeline
|
|
|
|
| 14 |
"sentiment-analysis",
|
| 15 |
model="avichr/hebEMO_"+emo,
|
| 16 |
tokenizer="avichr/heBERT",
|
| 17 |
+
device = self.device #-1 run on CPU, else - device ID
|
| 18 |
)
|
| 19 |
|
| 20 |
|