Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

fix: fall back to auto-detection when user VLM mapping fails

Roland Tannous8488c2b1df37
diff --git a/studio/backend/utils/datasets/dataset_utils.py b/studio/backend/utils/datasets/dataset_utils.py
index eb6ab864a21..2b430cee147 100644
--- a/studio/backend/utils/datasets/dataset_utils.py
+++ b/studio/backend/utils/datasets/dataset_utils.py
@@ -689,17 +689,15 @@ def format_and_template_dataset(
"errors": [],
}
except Exception as e:
- errors.append(f"Failed to apply user VLM mapping: {e}")
- return {
- "dataset": dataset,
- "detected_format": "user_mapped",
- "final_format": "vlm_conversion_failed",
- "is_vlm": True,
- "success": False,
- "requires_manual_mapping": True,
- "warnings": warnings,
- "errors": errors,
- }
+ # User mapping failed — fall back to auto-detection instead
+ # of giving up (handles stale cached mappings gracefully)
+ warnings.append(
+ f"User VLM mapping (image='{user_vlm_image_column}', "
+ f"text='{user_vlm_text_column}') failed: {e} — "
+ f"falling back to auto-detection"
+ )
+ print(f"⚠️ User VLM mapping failed, falling back to auto-detection...")
+ custom_format_mapping = None # clear so auto-detection runs below
else:
errors.append(
f"Invalid VLM mapping: need 'image' and 'text' roles. Got: {custom_format_mapping}"