From 3b6fc2eacb64d85cd6e196c4cc5c19f767b6e839 Mon Sep 17 00:00:00 2001 From: Andrea Pozzetti Date: Mon, 10 Nov 2025 17:53:05 +0000 Subject: [PATCH] dtype change --- nodes/sa2va/loader.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nodes/sa2va/loader.py b/nodes/sa2va/loader.py index 1f74cba..a795501 100644 --- a/nodes/sa2va/loader.py +++ b/nodes/sa2va/loader.py @@ -39,6 +39,12 @@ def load_sa2va(model_name, config, sa2va_dtype="auto"): } torch_dtype = dtype_map.get(sa2va_dtype, "auto") + # Force float32 on CPU to avoid dtype mismatches + # SA2VA with "auto" uses bfloat16 on GPU but this causes issues on CPU + if torch_dtype == "auto" and not torch.cuda.is_available(): + torch_dtype = torch.float32 + print(f"⚙️ Forcing float32 dtype for CPU compatibility") + print(f"📥 Loading model from HuggingFace ({hf_id})...") print(f"📂 Cache directory: {cache_dir}") print(f"⚠️ IMPORTANT: trust_remote_code=True is required for SA2VA")