Views
No views yet
1from transformers import DebertaV2Tokenizer, DebertaV2ForSequenceClassification
2import torch
3
4tokenizer = DebertaV2Tokenizer.from_pretrained("Shitanshu06/mcq-deberta-v3-large")
5model = DebertaV2ForSequenceClassification.from_pretrained("Shitanshu06/mcq-deberta-v3-large", num_labels=1)
6
7question = "What is dropout?"
8option = "To prevent overfitting"
9
10enc = tokenizer(question, option, return_tensors="pt", truncation=True, max_length=192)
11with torch.no_grad():
12 score = model(**enc).logits.item()