ciyidogan commited on
Commit
acfdca9
·
verified ·
1 Parent(s): 016ba45

Update inference_test_turkcell_with_intents.py

Browse files
inference_test_turkcell_with_intents.py CHANGED
@@ -124,7 +124,15 @@ def background_training(intents):
124
  trainer.train()
125
 
126
  # ✅ Başarı raporu üret
127
- predictions = model(tokenized["input_ids"]).logits.argmax(dim=-1).tolist()
 
 
 
 
 
 
 
 
128
  actuals = tokenized["label"]
129
  counts = {}
130
  correct = {}
 
124
  trainer.train()
125
 
126
  # ✅ Başarı raporu üret
127
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
128
+ model.to(device)
129
+ input_ids_tensor = tokenized["input_ids"].to(device)
130
+ attention_mask_tensor = tokenized["attention_mask"].to(device)
131
+
132
+ with torch.no_grad():
133
+ outputs = model(input_ids=input_ids_tensor, attention_mask=attention_mask_tensor)
134
+ predictions = outputs.logits.argmax(dim=-1).tolist()
135
+
136
  actuals = tokenized["label"]
137
  counts = {}
138
  correct = {}