Spaces:
Sleeping
Sleeping
model to device in eval
Browse files
qwen_classifier/evaluate.py
CHANGED
@@ -140,6 +140,7 @@ def _evaluate_local(test_data_path, hf_repo):
|
|
140 |
with torch.no_grad():
|
141 |
for batch in dataloader:
|
142 |
print(f"EVALUATION RUNNING ON {global_model.device}")
|
|
|
143 |
batch = {k: v.to(DEVICE) for k, v in batch.items()}
|
144 |
labels = batch["labels"].type(torch.float32)
|
145 |
|
|
|
140 |
with torch.no_grad():
|
141 |
for batch in dataloader:
|
142 |
print(f"EVALUATION RUNNING ON {global_model.device}")
|
143 |
+
global_model = global_model.to(DEVICE)
|
144 |
batch = {k: v.to(DEVICE) for k, v in batch.items()}
|
145 |
labels = batch["labels"].type(torch.float32)
|
146 |
|