Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -67,16 +67,22 @@ model = AutoModelForSequenceClassification.from_pretrained(model_name).to(device
|
|
67 |
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
|
68 |
|
69 |
# sentiment model - add no_cache=True and force_download=True
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
sentiment_model = AutoModelForSequenceClassification.from_pretrained(
|
71 |
"SamanthaStorm/tether-sentiment",
|
72 |
-
|
73 |
-
|
74 |
).to(device)
|
75 |
sentiment_tokenizer = AutoTokenizer.from_pretrained(
|
76 |
"SamanthaStorm/tether-sentiment",
|
77 |
use_fast=False,
|
78 |
-
|
79 |
-
|
80 |
)
|
81 |
|
82 |
# After loading the sentiment model
|
@@ -85,6 +91,7 @@ logger.debug(f"Model name: {sentiment_model.config.name_or_path}")
|
|
85 |
logger.debug(f"Last modified: {sentiment_model.config._name_or_path}")
|
86 |
|
87 |
|
|
|
88 |
emotion_pipeline = hf_pipeline(
|
89 |
"text-classification",
|
90 |
model="j-hartmann/emotion-english-distilroberta-base",
|
|
|
67 |
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
|
68 |
|
69 |
# sentiment model - add no_cache=True and force_download=True
|
70 |
+
# Model initialization
|
71 |
+
model_name = "SamanthaStorm/tether-multilabel-v4"
|
72 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name).to(device)
|
73 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
|
74 |
+
|
75 |
+
# sentiment model
|
76 |
sentiment_model = AutoModelForSequenceClassification.from_pretrained(
|
77 |
"SamanthaStorm/tether-sentiment",
|
78 |
+
force_download=True,
|
79 |
+
local_files_only=False
|
80 |
).to(device)
|
81 |
sentiment_tokenizer = AutoTokenizer.from_pretrained(
|
82 |
"SamanthaStorm/tether-sentiment",
|
83 |
use_fast=False,
|
84 |
+
force_download=True,
|
85 |
+
local_files_only=False
|
86 |
)
|
87 |
|
88 |
# After loading the sentiment model
|
|
|
91 |
logger.debug(f"Last modified: {sentiment_model.config._name_or_path}")
|
92 |
|
93 |
|
94 |
+
|
95 |
emotion_pipeline = hf_pipeline(
|
96 |
"text-classification",
|
97 |
model="j-hartmann/emotion-english-distilroberta-base",
|