Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.
Rust agentai-agentapplecomputer-usecomputer-use-agentcontainerizationcuadesktop-automationhacktoberfestlumemacosmanusoperatorswiftvirtualizationvirtualization-frameworkwindowswindows-sandbox
Fix torch dependency in cua-agent
Dillon DuPont090edb8f3356
diff --git a/libs/python/agent/agent/loops/moondream3.py b/libs/python/agent/agent/loops/moondream3.pyindex 140c9cb404..5f6a85fd0c 100644--- a/libs/python/agent/agent/loops/moondream3.py+++ b/libs/python/agent/agent/loops/moondream3.py@@ -20,8 +20,6 @@ import iofrom typing import Dict, List, Any, Optional, Tuple, Anyfrom PIL import Image, ImageDraw, ImageFont-import torch-from transformers import AutoModelForCausalLMimport litellmfrom ..decorators import register_agent@@ -41,12 +39,19 @@ def get_moondream_model() -> Any:"""Get a singleton instance of the Moondream3 preview model."""global _MOONDREAM_SINGLETONif _MOONDREAM_SINGLETON is None:- _MOONDREAM_SINGLETON = AutoModelForCausalLM.from_pretrained(- "moondream/moondream3-preview",- trust_remote_code=True,- torch_dtype=torch.bfloat16,- device_map="cuda",- )+ try:+ import torch+ from transformers import AutoModelForCausalLM+ _MOONDREAM_SINGLETON = AutoModelForCausalLM.from_pretrained(+ "moondream/moondream3-preview",+ trust_remote_code=True,+ torch_dtype=torch.bfloat16,+ device_map="cuda",+ )+ except ImportError as e:+ raise RuntimeError(+ "moondream3 requires torch and transformers. Install with: pip install cua-agent[moondream3]"+ ) from ereturn _MOONDREAM_SINGLETONdiff --git a/libs/python/agent/pyproject.toml b/libs/python/agent/pyproject.tomlindex e9064f491b..de735b7f94 100644--- a/libs/python/agent/pyproject.toml+++ b/libs/python/agent/pyproject.toml@@ -60,6 +60,11 @@ internvl-hf = ["einops","timm"]+moondream3 = [+ "accelerate",+ "torch",+ "transformers>=4.55.0"+]ui = ["gradio>=5.23.3","python-dotenv>=1.0.1",