Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

Move inputs to model's same device, previously hardcoded to CUDA

cgutierr978181045151
diff --git a/libs/python/agent/agent/adapters/huggingfacelocal_adapter.py b/libs/python/agent/agent/adapters/huggingfacelocal_adapter.py
index 2228605983..46be5e9858 100644
--- a/libs/python/agent/agent/adapters/huggingfacelocal_adapter.py
+++ b/libs/python/agent/agent/adapters/huggingfacelocal_adapter.py
@@ -141,8 +141,7 @@ class HuggingFaceLocalAdapter(CustomLLM):
)
# Move inputs to the same device as model
- if torch.cuda.is_available() and self.device != "cpu":
- inputs = inputs.to("cuda")
+ inputs = inputs.to(model.device)
# Generate response
with torch.no_grad():