fix(qwen3-vl): fall back to hf_hub_download for mmraw preprocessor_config.json#82
Merged
hubert-marek merged 2 commits intoJun 10, 2026
Conversation
…nfig.json The raw-image (mmraw) layout path resolves the model's image geometry from preprocessor_config.json, but _load_preprocessor_config_json only checked local paths and the local HF cache (try_to_load_from_cache). Hosted env workers render models they never loaded locally, so hub-style ids always missed the cache and every image rollout failed with RuntimeError: Qwen raw image layout could not find preprocessor_config.json for 'Qwen/Qwen3.6-35B-A3B' ... even when the file is publicly available on the Hub. Add an hf_hub_download fallback on cache miss (a few hundred bytes, lands in the HF cache, then memoized by the lru_cache). Offline/no-network workers fall through to the existing RuntimeError, whose message now also mentions Hub reachability alongside the explicit image_* config escape hatch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ApprovabilityVerdict: Approved Straightforward bug fix adding a fallback to download preprocessor_config.json from Hugging Face Hub when local cache misses. The change is small, self-contained with proper error handling, and includes comprehensive test coverage. You can customize Macroscope's approvability policy. Learn more. |
eligotts
approved these changes
Jun 10, 2026
Author
|
@cursoragent fix the ruff and style here - make comments concise |
|
You need to increase your spend limit or enable usage-based billing to run background agents. Go to Cursor |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Dismissing prior approval to re-evaluate f146935
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The raw-image (mmraw) layout path (db5058e) resolves the model's image geometry from
preprocessor_config.json, but_load_preprocessor_config_jsononly checks local paths and the local HF cache (try_to_load_from_cache). Hosted env workers render models they never loaded locally, so hub-style ids always miss the cache and every image rollout fails:…even when the file is publicly available on the Hub. Hit in production on worldsims gflights-booking RL runs (Qwen3.6-35B-A3B); currently worked around by passing the five explicit
image_*layout fields throughchat_template_kwargsin the run config.Fix
On cache miss for a hub-style id, fall back to
hf_hub_download(model_id, "preprocessor_config.json")— a few hundred bytes, lands in the HF cache, then memoized by the existinglru_cache. Offline/no-network workers fall through to the existingRuntimeError, whose message now also mentions Hub reachability alongside the explicitimage_*config escape hatch.Test
test_qwen3_vl_preprocessor_config_hub_download_fallback: cache-miss → fallback download succeeds and parses; offline download failure →RuntimeErrorpreserved.🤖 Generated with Claude Code
Note
Low Risk
Narrow change to config resolution for hub model IDs with existing error paths when offline; adds optional Hub network fetch on cache miss only.
Overview
Fixes Qwen3-VL mmraw image rollouts on workers that never cached the model locally: when
preprocessor_config.jsonis missing from disk andtry_to_load_from_cachemisses,_load_preprocessor_config_jsonnow falls back tohf_hub_download(small file, then existinglru_cache). Offline or failed downloads still raise the sameRuntimeError, with an updated message that also points to Hub reachability and explicitimage_*layout overrides.Adds
test_qwen3_vl_preprocessor_config_hub_download_fallbackto cover successful hub fallback and preserved failure when download is unavailable.Reviewed by Cursor Bugbot for commit f146935. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fall back to
hf_hub_downloadin_load_preprocessor_config_jsonfor Qwen3-VL when cache missesPreviously,
_load_preprocessor_config_jsonin qwen3_vl.py would raise aRuntimeErrorif no cachedpreprocessor_config.jsonwas found for a hub-style model ID. It now attemptshf_hub_downloadas a fallback before raising. The error message is also updated to mention that the model must be reachable on the Hugging Face Hub.Changes since #82 opened
_load_preprocessor_config_jsonutility function [f146935]Macroscope summarized 91f3040.