From de873eae2dab2d1c72c33d465663f4d77c4f819b Mon Sep 17 00:00:00 2001 From: William Lin Date: Mon, 2 Nov 2026 13:42:08 -0800 Subject: [PATCH] [bugfix] Pass disable_autocast through to FastVideoArgs (#2056) --- docs-site/islands/Cookbook.tsx | 4 +--- fastvideo/fastvideo_args.py | 2 ++ fastvideo/tests/api/test_compat_translation.py | 9 +++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs-site/islands/Cookbook.tsx b/docs-site/islands/Cookbook.tsx index a34d479a4..3d44c755b 100644 --- a/docs-site/islands/Cookbook.tsx +++ b/docs-site/islands/Cookbook.tsx @@ -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. */ diff --git a/fastvideo/fastvideo_args.py b/fastvideo/fastvideo_args.py index 818834e18..7024fe716 100644 --- a/fastvideo/fastvideo_args.py +++ b/fastvideo/fastvideo_args.py @@ -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 diff --git a/fastvideo/tests/api/test_compat_translation.py b/fastvideo/tests/api/test_compat_translation.py index f84545532..0f28e3eff 100644 --- a/fastvideo/tests/api/test_compat_translation.py +++ b/fastvideo/tests/api/test_compat_translation.py @@ -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