YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Mindcast SD_SC 톡합 λͺ¨λΈ

πŸš€ κ°„λ‹¨ν•œ μ‚¬μš©λ²•

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'}
Downloads last month
1
Safetensors
Model size
0.3B params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support