Skip to content

fix(mot): resolve shipped model-config JSONs relative to the package …#51

Merged
foreverlms merged 1 commit into
mainfrom
fix/mot-config-package-relative-path
Jun 18, 2026
Merged

fix(mot): resolve shipped model-config JSONs relative to the package …#51
foreverlms merged 1 commit into
mainfrom
fix/mot-config-package-relative-path

Conversation

@foreverlms

Copy link
Copy Markdown
Collaborator

…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.

…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>
@foreverlms foreverlms merged commit 15efd54 into main Jun 18, 2026
12 of 13 checks passed
@foreverlms foreverlms deleted the fix/mot-config-package-relative-path branch June 18, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants