[bugfix] Pass disable_autocast through to FastVideoArgs (#2056)

This commit is contained in:
William Lin
2026-11-02 13:42:08 -08:00
committed by GitHub
parent 4f80c5a3da
commit de873eae2d
3 changed files with 12 additions and 3 deletions
+1 -3
View File
@@ -878,9 +878,7 @@ function configurableModes(index: Index | undefined, modelId: string): string[]
if (!deployments?.length) return undefined;
const servingOnly = (deployment: { runtime: string; workload: string }) =>
deployment.runtime.includes("mlx") || deployment.runtime.includes("streaming") || deployment.workload === "v2v";
return deployments.some((deployment) => !servingOnly(deployment))
? ["Python SDK", "CLI", "Serving"]
: ["Serving"];
return deployments.some((deployment) => !servingOnly(deployment)) ? ["Python SDK", "CLI", "Serving"] : ["Serving"];
}
/** Mirrors the source recipe page: Python SDK and CLI always, serving when a recipe declares it. */
+2
View File
@@ -1030,6 +1030,8 @@ class FastVideoArgs:
kwargs['workload_type'] = WorkloadType.from_string(kwargs['workload_type'])
kwargs['pipeline_config'] = PipelineConfig.from_kwargs(kwargs)
# PipelineConfig also has a disable_autocast field and pops it from kwargs, but the stages read this one.
kwargs.setdefault('disable_autocast', kwargs['pipeline_config'].disable_autocast)
kwargs['preprocess_config'] = PreprocessConfig.from_kwargs(kwargs)
# Filter to only FastVideoArgs dataclass fields — pipeline-specific CLI
# args live in PipelineConfig and must not be forwarded to the
@@ -233,3 +233,12 @@ def _stub_fastvideo_args_from_kwargs(monkeypatch):
self.kwargs = kw
monkeypatch.setattr(fva.FastVideoArgs, "from_kwargs", _Captured)
def test_disable_autocast_reaches_fastvideo_args(monkeypatch) -> None:
"""``PipelineConfig.from_kwargs`` pops ``disable_autocast`` too; the denoising stages read the FastVideoArgs copy."""
from fastvideo import registry
monkeypatch.setattr(registry, "get_pipeline_config_cls_from_name", lambda model_path: None)
for value in (True, False):
config = legacy_from_pretrained_to_config("/models/any", {"disable_autocast": value})
assert generator_config_to_fastvideo_args(config).disable_autocast is value