Downloads · 30 days
5
12% of all-time downloads
merrybabyxmas/mindcast-unified-sd-sc
mindcast-unified-sd-sc is a machine learning model from merrybabyxmas. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
5
12% of all-time downloads
All-time downloads
43
Public
Parameters
332M
1.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.3 GB · 100%
From the Hugging Face model README
from transformers import AutoTokenizer, AutoModelForSequenceClassification
# 모델 및 토크나이저 로드
tokenizer = AutoTokenizer.from_pretrained("merrybabyxmas/mindcast-unified-sd-sc")
model = AutoModelForSequenceClassification.from_pretrained(
"merrybabyxmas/mindcast-unified-sd-sc",
trust_remote_code=True
)
# 텍스트 토크나이징
text = "아 진짜 최고다~ 완전 망했네"
inputs = tokenizer(text, return_tensors="pt")
# 예측
with torch.no_grad():
outputs = model(**inputs, return_intermediate_results=True)
# 결과 해석
emotion_probs = torch.softmax(outputs['logits'], dim=-1)
sarcasm_pred = outputs['sarcasm_predictions'][0].item()
emotion_pred = torch.argmax(emotion_probs, dim=-1)[0].item()
print(f"Sarcasm: {model.config.sarcasm_labels[sarcasm_pred]}")
print(f"Emotion: {model.config.emotion_labels[emotion_pred]}")
# 모델의 predict 함수 사용
result = model.predict(inputs['input_ids'], inputs['attention_mask'], tokenizer)
print(result)
# {'sarcasm': 'Sarcastic', 'emotion': '분노', 'model_used': 'sarcastic'}