Getting KeyError: 'logits' when trying to run deberta model
!pip install sentencepiece --upgrade
!pip install transformers --upgrade
from transformers import pipeline,AutoModel,AutoTokenizer

model =AutoModel.from_pretrained("microsoft/deberta-v2-xxlarge-mnli")
tokenizer = AutoTokenizer.from_pretrained("microsoft/deberta-v2-xxlarge")
classifier = pipeline("zero-shot-classification",model=model,tokenizer=tokenizer)

sequence = "Bob: Hey, how is work going? , Amy: Good, I wanted to talk to you about your work performance."
candidate_labels = ["Bob is talking about the same topic as Amy.", "Amy explained to Bob why he is not doing well.", "Bob asked how Amy is.", "Bob brought up the topic of work performance."]

print(classifier(sequence, candidate_labels))
2021-10-23T06:39:14Z
also, how do I fine-tune such a model for my purpose?
2022-07-27T18:26:13Z
Were you able to solve the issue? I’m having the same issue.
2022-07-28T07:55:00Z
Hi,You need to replaceAutoModelbyAutoModelForSequenceClassificationin the code snippet above (sinceAutoModeldoesn’t include a classification head on top).