Repository navigation
fix(inference): reject a missing negative_prompt_file and flag ignored negative-metadata settings - #354
Open
rwagwani wants to merge 2 commits into
Open
fix(inference): reject a missing negative_prompt_file and flag ignored negative-metadata settings#354rwagwani wants to merge 2 commits into
rwagwani wants to merge 2 commits into
Conversation
…d negative-metadata settings Follow-up to NVIDIA#338. - negative_prompt_file is validated when the sample is parsed. A relative path resolves against the spec file's folder (as vision_path and prompt_path do), and a bare filename under defaults/ is still accepted. A path that does not exist now fails before model load, instead of passing silently whenever a default negative_prompt wins. - negative_metadata_mode and negative_prompt_keep_metadata join the distilled causal Transfer ignored-fields table (neutral values: none / false). No change to which negative caption is used, so cookbook and Sim-Transfer skill outputs are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ddress review - Resolve a relative negative_prompt_file from the launch folder first (where it was read from before), then the spec's folder; a defaults-file entry is also tried next to that defaults file. - Apply the defaults/ fallback to a bare filename only. - Check negative_metadata_mode against the requested value, so a keep_metadata promotion of 'none' to 'same' does not warn. - Update a stale comment in transfer_shipped_specs_test.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Follow-up to #338, covering the two items it listed as not covered.
Summary
A missing
negative_prompt_fileis now rejected when the sample is parsed, before the model loads. Before, the file was read only when nonegative_promptwas set; in almost every setup a defaultnegative_promptwins first, so a typo in the path was accepted with no message. Lookup order:../assets/negative_prompt.jsonlayout);defaults/(for exampleneg_prompts.json).A
negative_prompt_fileinside a--defaults-fileis also tried next to that defaults file. A path that is not found fails with:negative_metadata_modeandnegative_prompt_keep_metadatawarn on distilled causal Transfer. They are added to_DISTILLED_TRANSFER_IGNORED_FIELDS, with neutral valuesnoneandfalse, so a request that sets them gets the same[transfer] '<field>' is ignored by distilled causal Transfer: ...warning as the other fix(inference): warn when a transfer setting cannot take effect #338 fields. The distilled schedule has no negative-caption branch, so neither setting is read.Not changed
Behaviour change, stated plainly
negative_prompt_file, and it lists every path it tried. Every shipped cookbook spec and Sim-Transfer skill request still builds;transfer_shipped_specs_test.pycovers this.--defaults-file. A setup that carried an unused, broken path now fails, by design.vision_path, so--skip-invalid-samplesdoes not skip it.negative_metadata_modeis checked against the value the request set, sononedoes not warn whennegative_prompt_keep_metadatafrom the defaults promotes it tosame.Verification
sim_transfer_args_test.py:defaults/filename is still accepted, but a path such astypo_dir/neg_prompts.jsonis notnegative_metadata_modewarningnegative_metadata_modenone/same/inverseandnegative_prompt_keep_metadatafalse/truewarn only for non-neutral valuestest_unused_negative_prompt_file_is_not_openednow uses a file that exists, because a missing path is rejected earlier. It still checks that the file is not read when a default caption wins. A stale comment intransfer_shipped_specs_test.pyis updated.pytest cosmos_framework/inference/sim_transfer_args_test.py cosmos_framework/inference/transfer_shipped_specs_test.py cosmos_framework/inference/args_test.py: 159 passed.pytest cosmos_framework/inference/ -m "not GPU": the same 7 failures as main (auto_rig_frontend_testx1,model_testx6), no new ones.neg.json, with the spec elsewhere, still resolves to the launch folder's file.ruff checkandruff format --check: clean.negative_prompt_file: "missing_negative.json"was accepted silently before. Now it stops before model load with the message above.negative_prompt_filestill runs, with an unchanged result, and logs[transfer] 'negative_prompt_file' is ignored by distilled causal Transfer: the distilled schedule has no negative-caption branch.negative_metadata_mode: "same"runs, with an unchanged result, and now logs[transfer] 'negative_metadata_mode' is ignored by distilled causal Transfer: the distilled schedule has no negative-caption branch to add metadata to.🤖 Generated with Claude Code