fix(mot): resolve shipped model-config JSONs relative to the package …#51
Merged
Merged
Conversation
…root _MoTConfigBase.from_json_file open()'d its json_file argument verbatim. The shipped config defaults (configs/base/defaults/vlm.py) pass repo-root-relative paths like "cosmos_framework/model/vfm/vlm/qwen3_vl/configs/Qwen3-VL-8B-Instruct.json", so model construction only worked when the process CWD was the framework repo root. Launching cosmos_framework.scripts.train from any other directory (e.g. a cookbook folder) raised FileNotFoundError. Resolve a relative json_file that does not exist against the CWD against the installed package root (parent of the cosmos_framework package — the repo root for editable installs, site-packages for wheels; the JSONs ship there in both). Absolute paths and CWD-relative paths that exist are returned unchanged, so behavior is unchanged when launched from the repo root. Mirrors the package-root resolution the inference path already does via chdir, without mutating global process state. Add unified_mot_test.py covering the helper and from_json_file from a foreign CWD. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Dinghow
approved these changes
Jun 17, 2026
lfengad
approved these changes
Jun 17, 2026
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.
…root
_MoTConfigBase.from_json_file open()'d its json_file argument verbatim. The shipped config defaults (configs/base/defaults/vlm.py) pass repo-root-relative paths like "cosmos_framework/model/vfm/vlm/qwen3_vl/configs/Qwen3-VL-8B-Instruct.json", so model construction only worked when the process CWD was the framework repo root. Launching cosmos_framework.scripts.train from any other directory (e.g. a cookbook folder) raised FileNotFoundError.
Resolve a relative json_file that does not exist against the CWD against the installed package root (parent of the cosmos_framework package — the repo root for editable installs, site-packages for wheels; the JSONs ship there in both). Absolute paths and CWD-relative paths that exist are returned unchanged, so behavior is unchanged when launched from the repo root. Mirrors the package-root resolution the inference path already does via chdir, without mutating global process state.
Add unified_mot_test.py covering the helper and from_json_file from a foreign CWD.