diff --git a/miles/rollout/encoder_hub/__init__.py b/miles/rollout/encoder_hub/__init__.py index 4e04b245..98b9e032 100644 --- a/miles/rollout/encoder_hub/__init__.py +++ b/miles/rollout/encoder_hub/__init__.py @@ -14,4 +14,7 @@ def get_encoder(family: str | None): from miles.rollout.encoder_hub import wan2_2 return wan2_2 - raise ValueError(f"no encoder_hub entry for model family {family!r}") + raise ValueError( + f"no encoder_hub entry for model family {family!r}; set --diffusion-model-family to one " + "that has an entry, or add a module here for it" + ) diff --git a/miles/utils/arguments.py b/miles/utils/arguments.py index 05b2e30e..725625e5 100644 --- a/miles/utils/arguments.py +++ b/miles/utils/arguments.py @@ -1472,12 +1472,15 @@ def miles_validate_args(args): from miles.utils.misc import load_function + if args.diffusion_model_family is not None: + # Downstream lookups compare this exactly (encoder_hub.get_encoder), so normalize once + # here rather than at every reader. + args.diffusion_model_family = args.diffusion_model_family.strip().lower() + if args.train_pipeline_config_path is not None: - if args.diffusion_model_family is not None: - raise ValueError("--train-pipeline-config-path and --diffusion-model-family both name a config; pass one.") - # Explicit config path IS the identity (custom classes never need registering). + # The path names the config class; the family stays whatever was passed, since it is a + # separate axis (encoder_hub) and may be unset for a model that customizes that too. cfg_cls = load_function(args.train_pipeline_config_path) - args.diffusion_model_family = None else: from miles.backends.fsdp_utils.configs.train_pipeline_config import ( get_train_pipeline_config_cls, @@ -1486,10 +1489,6 @@ def miles_validate_args(args): if args.diffusion_model_family is None: args.diffusion_model_family = resolve_diffusion_model_family(args.hf_checkpoint) - else: - # Downstream lookups compare this exactly (encoder_hub.get_encoder), so normalize - # here rather than at every reader. - args.diffusion_model_family = args.diffusion_model_family.strip().lower() cfg_cls = get_train_pipeline_config_cls(args.diffusion_model_family) args.train_pipeline_config_path = f"{cfg_cls.__module__}.{cfg_cls.__qualname__}" if args.model_backend_path is None: