Fix: Ensure model is moved to same device as inputs in example code

#7
Files changed (1) hide show
  1. README.md +1 -1
README.md CHANGED
@@ -62,7 +62,7 @@ device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cp
62
 
63
  model_name = "MoritzLaurer/mDeBERTa-v3-base-mnli-xnli"
64
  tokenizer = AutoTokenizer.from_pretrained(model_name)
65
- model = AutoModelForSequenceClassification.from_pretrained(model_name)
66
 
67
  premise = "Angela Merkel ist eine Politikerin in Deutschland und Vorsitzende der CDU"
68
  hypothesis = "Emmanuel Macron is the President of France"
 
62
 
63
  model_name = "MoritzLaurer/mDeBERTa-v3-base-mnli-xnli"
64
  tokenizer = AutoTokenizer.from_pretrained(model_name)
65
+ model = AutoModelForSequenceClassification.from_pretrained(model_name).to(device)
66
 
67
  premise = "Angela Merkel ist eine Politikerin in Deutschland und Vorsitzende der CDU"
68
  hypothesis = "Emmanuel Macron is the President of France"