Downloads · 30 days
704
15% of all-time downloads
bsu-slim/gred-cozmo
gred-cozmo is a machine learning model from bsu-slim. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
This is a GPT-2-medium-based language model fine-tuned to generate robot behaviors given an emotion label. It is trained on emotion-behavior data collected from the Cozmo robot and produces textual descriptions of Coz…
Downloads · 30 days
704
15% of all-time downloads
All-time downloads
4.8K
Public
Parameters
355M
1.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.4 GB · 100%
From the Hugging Face model README
This is a GPT-2-medium-based language model fine-tuned to generate robot behaviors given an emotion label. It is trained on emotion-behavior data collected from the Cozmo robot and produces textual descriptions of Cozmo's actions that align with the given emotion.
Base Model: GPT-2 Medium
Model type: Causal Language Model
Inputs: Prompt of the form Emotion: <emotion> Behaviors:
Outputs: A text sequence representing Cozmo robot behaviors
Development code: https://github.com/bsu-slim/emro-gred-cozmo
This model was trained on 6 grouped emotions:
anger_frustrationconfusion_sorrow_boredomdisgust_surprise_alarm_fearinterest_desirejoy_hopeunderstanding_gratitude_relieffrom transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_name = "bsu-slim/gred-cozmo"
model = AutoModelForCausalLM.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False) # use_fast=False recommended
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)
model.eval()
emotion = "joy_hope"
prompt = f"<|startoftext|>Emotion: {emotion} <|endoftext|> Behaviors:"
inputs = tokenizer(prompt, return_tensors="pt").to(device)
# Generate behaviors
output = model.generate(
**inputs,
max_new_tokens=50,
do_sample=True,
top_k=50,
top_p=0.95,
pad_token_id=tokenizer.eos_token_id
)
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
print(f"Input Emotion: {emotion}")
print("Generated Behavior:")
print(generated_text.split("Behaviors:")[1].strip())
Example Output
Input Emotion: joy_hope
Generated Behavior:
display_oled_face_image_face8_1 say_text_oh!_1_1 set_head_angle_45_1 drive_straight_100_50 display_oled_face_image_face8_1
Citation
@INPROCEEDINGS{11246523,
author={Baral, Rista and Grenz, Bethany and Kennington, Casey},
booktitle={2025 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
title={Recognizing and Generating Novel Emotional Behaviors on Two Robotic Platforms},
year={2025},
volume={},
number={},
pages={21503-21510},
keywords={Training;Emotion recognition;Behavioral sciences;Robots;Intelligent robots},
doi={10.1109/IROS60139.2025.11246523}}