Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -29,15 +29,13 @@ tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
|
|
29 |
sentiment_model = AutoModelForSequenceClassification.from_pretrained("SamanthaStorm/tether-sentiment").to(device)
|
30 |
sentiment_tokenizer = AutoTokenizer.from_pretrained("SamanthaStorm/tether-sentiment", use_fast=False)
|
31 |
|
32 |
-
|
33 |
-
emotion_pipeline = hf_pipeline(
|
34 |
"text-classification",
|
35 |
model="j-hartmann/emotion-english-distilroberta-base",
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
)
|
40 |
-
|
41 |
# DARVO model
|
42 |
darvo_model = AutoModelForSequenceClassification.from_pretrained("SamanthaStorm/tether-darvo-regressor-v1").to(device)
|
43 |
darvo_tokenizer = AutoTokenizer.from_pretrained("SamanthaStorm/tether-darvo-regressor-v1", use_fast=False)
|
|
|
29 |
sentiment_model = AutoModelForSequenceClassification.from_pretrained("SamanthaStorm/tether-sentiment").to(device)
|
30 |
sentiment_tokenizer = AutoTokenizer.from_pretrained("SamanthaStorm/tether-sentiment", use_fast=False)
|
31 |
|
32 |
+
emotion_pipeline = pipeline(
|
|
|
33 |
"text-classification",
|
34 |
model="j-hartmann/emotion-english-distilroberta-base",
|
35 |
+
tokenizer="j-hartmann/emotion-english-distilroberta-base",
|
36 |
+
return_all_scores=True, # ← ensure we get all six scores, not just top-1
|
37 |
+
top_k=None # ← ensure no automatic top-k truncation (so you see all labels)
|
38 |
)
|
|
|
39 |
# DARVO model
|
40 |
darvo_model = AutoModelForSequenceClassification.from_pretrained("SamanthaStorm/tether-darvo-regressor-v1").to(device)
|
41 |
darvo_tokenizer = AutoTokenizer.from_pretrained("SamanthaStorm/tether-darvo-regressor-v1", use_fast=False)
|