Views
No views yet
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4# Load model and tokenizer
5tokenizer = AutoTokenizer.from_pretrained("{hub_model_id}")
6model = AutoModelForSequenceClassification.from_pretrained("{hub_model_id}")
7
8# Prepare input
9text = "I need help with my billing issue urgently!"
10inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=256)
11
12# Get predictions
13with torch.no_grad():
14 outputs = model(**inputs)
15 probs = torch.sigmoid(outputs.logits)[0]
16
17# Get predicted labels (threshold = 0.5)
18predicted_labels = []
19for idx, prob in enumerate(probs):
20 if prob > 0.5:
21 label = model.config.id2label[idx]
22 predicted_labels.append((label, prob.item()))
23
24print(predicted_labels)1@misc{{mdeberta-eurochef-2026,
2 author = {{BenTouss}},
3 title = {{mDeBERTa-v3-base Fine-tuned on EuroChef+ Customer Support}},
4 year = {{2026}},
5 publisher = {{Hugging Face}},
6 howpublished = {{\\url{{https://huggingface.co/{hub_model_id}}}}}
7}}