Spaces:
Running
Running
kovacsvi
commited on
Commit
·
7939f19
1
Parent(s):
410b6ef
use v2 emotion9 models if available
Browse files- interfaces/emotion9.py +4 -1
interfaces/emotion9.py
CHANGED
@@ -22,7 +22,10 @@ domains = {
|
|
22 |
|
23 |
def build_huggingface_path(language: str):
|
24 |
language = language.lower()
|
25 |
-
|
|
|
|
|
|
|
26 |
|
27 |
def predict(text, model_id, tokenizer_id):
|
28 |
device = torch.device("cpu")
|
|
|
22 |
|
23 |
def build_huggingface_path(language: str):
|
24 |
language = language.lower()
|
25 |
+
base_model_id = f"poltextlab/xlm-roberta-large-pooled-{language}-emotions9"
|
26 |
+
if language in ["slovak", "polish", "czech", "hungarian"]:
|
27 |
+
return base_model_id + "-v2"
|
28 |
+
return base_model_id
|
29 |
|
30 |
def predict(text, model_id, tokenizer_id):
|
31 |
device = torch.device("cpu")
|