Downloads · 30 days
0
annamanaseryan/cozmo-emotion-sft
cozmo-emotion-sft is a text classification model from annamanaseryan. Use it when you need a label for a piece of text. It is set up for transformers.
Supervised fine-tuned (SFT) emotion classifier for human–robot dialogue turns. Predicts one of 6 emotion classes from a paired utterance:
Downloads · 30 days
0
Access
Public
Updated Aug 21, 2026
Repo size
738 MB
Likes
0
Public
Click a slice to open those files.
.bin735 MB · 99%
From the Hugging Face model README
Supervised fine-tuned (SFT) emotion classifier for human–robot dialogue turns. Predicts one of 6 emotion classes from a paired utterance:
HUMAN: {human_text}
ROBOT: {robot_text}
This repo is the base classifier used by the GRPO LoRA adapter:
annamanaseryan/cozmo-emotion-grpo.
microsoft/deberta-v3-basemodeling_emotion.py (EmotionClassifier)Not a drop-in
AutoModelForSequenceClassificationcheckpoint. Load with the provided class +best_model.bin.
| Id | Description |
|---|---|
| 0 | anger_frustration |
| 1 | interest_desire |
| 2 | confusion_sorrow_boredom |
| 3 | joy_hope |
| 4 | understanding_gratitude_relief |
| 5 | disgust_surprise_alarm_fear |
Full names are in emotion_labels.yaml.
| File | Role |
|---|---|
best_model.bin | SFT state_dict for EmotionClassifier |
modeling_emotion.py | Model definition |
emotion_labels.yaml | Label map |
| Tokenizer files | Same tokenizer used in training |
pip install torch transformers pyyaml huggingface_hub
import torch
import yaml
from huggingface_hub import hf_hub_download, snapshot_download
from transformers import AutoTokenizer
from modeling_emotion import EmotionClassifier # download this file from the repo
REPO = "annamanaseryan/cozmo-emotion-sft"
device = "cuda" if torch.cuda.is_available() else "cpu"
# Prefer downloading the whole repo once, then import modeling_emotion from that folder
local = snapshot_download(REPO)
import sys
sys.path.insert(0, local)
from modeling_emotion import EmotionClassifier
with open(f"{local}/emotion_labels.yaml") as f:
cfg = yaml.safe_load(f)
id2desc = {int(i): d["description"] for i, d in cfg["emotions"].items()}
tokenizer = AutoTokenizer.from_pretrained(local)
model = EmotionClassifier(n_classes=6, model_name="microsoft/deberta-v3-base")
state = torch.load(f"{local}/best_model.bin", map_location="cpu")
model.load_state_dict(state)
model.to(device).eval()
def predict(human: str, robot: str, max_length: int = 256):
text = f"HUMAN: {human}\nROBOT: {robot}"
inputs = tokenizer(
text,
return_tensors="pt",
max_length=max_length,
padding="max_length",
truncation=True,
).to(device)
with torch.no_grad():
logits = model(**inputs)
probs = torch.softmax(logits, dim=-1).cpu().squeeze()
return {id2desc[i]: float(probs[i]) for i in range(len(probs))}
print(predict("Why is the sky blue?", "because of the light."))
See the companion adapter repo and inference_example.py there.