Fix model path in Qwen-Image-Distill-DMD2 examples - #1665
Open
rakhimovv wants to merge 1 commit into
Open
Conversation
snapshot_download was called with cache_dir=, which writes the hub cache layout (models/models/<owner>--<repo>/snapshots/<rev>/), but the following load_state_dict reads the local_dir layout (models/<owner>/<repo>/), so the file is never found. Other examples in the repo use local_dir= for this.
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.
Thanks for this project — I've been working through the
examples/qwen_image/scripts and hit a few small things; this is the most clear-cut one.Both
Qwen-Image-Distill-DMD2.pyexamples download the distill LoRA into one directory layout and read it back from another, so the load fails.model_inference/Qwen-Image-Distill-DMD2.py:18-19:With modelscope 1.39.1,
cache_dir=writes the hub cache layout, so the file lands at:while the next line reads the
local_dir=layout,models/MusePublic/Qwen-Image-Distill/.... The download reports success and the read then fails:I first hit this during a CDN timeout and assumed that was the cause, but a clean, fully successful download fails the same way. Since the cache layout has changed across modelscope versions, I'd guess this worked when it was written.
These are the only two call sites in the repo using
cache_dir=: of 321snapshot_download(...)calls underexamples/at4dbf980, 319 passlocal_dir=and these 2 passcache_dir=. The patch switches them tolocal_dir=, matching the siblingQwen-Image-Distill-LoRA.py:5.Checking
Both scripts fail at
4dbf980and produce an image with this patch, on 1×H100 downloading from ModelScope:model_inference/Qwen-Image-Distill-DMD2.py— 53smodel_inference_low_vram/Qwen-Image-Distill-DMD2.py— 69s