diff --git a/studio/backend/core/inference/diffusion_te_prequant.py b/studio/backend/core/inference/diffusion_te_prequant.py index 886e968d1b..d95363ee06 100644 --- a/studio/backend/core/inference/diffusion_te_prequant.py +++ b/studio/backend/core/inference/diffusion_te_prequant.py @@ -146,10 +146,7 @@ def resolve_te_prequant_source( def te_prequant_sources( - fam: Any, - *, - te_quant_mode: Optional[str], - target: Any, + fam: Any, *, te_quant_mode: Optional[str], target: Any ) -> dict[str, TePrequantSource]: """``{component: source}`` for every text encoder this pick would load PRE-CAST rather than dense; ``{}`` when none apply. diff --git a/studio/backend/core/inference/video.py b/studio/backend/core/inference/video.py index 30cea83620..8157c4cbc0 100644 --- a/studio/backend/core/inference/video.py +++ b/studio/backend/core/inference/video.py @@ -682,7 +682,6 @@ class VideoBackend: """``{component: source}`` for the text encoders this load will take PRE-CAST from a hosted checkpoint instead of the base repo's dense weights (``{}`` when none).""" from .diffusion_te_prequant import te_prequant_sources - return te_prequant_sources( fam, te_quant_mode = text_encoder_quant, diff --git a/studio/backend/tests/test_video_backend.py b/studio/backend/tests/test_video_backend.py index 88425a1559..73266ef882 100644 --- a/studio/backend/tests/test_video_backend.py +++ b/studio/backend/tests/test_video_backend.py @@ -1112,7 +1112,13 @@ def _ltx23_assembly_stubs(monkeypatch, tmp_path): self.what = what @classmethod - def from_pretrained(cls, base, subfolder = None, token = None, **extra): + def from_pretrained( + cls, + base, + subfolder = None, + token = None, + **extra, + ): _Loaded.calls.append(subfolder) return cls(subfolder or "?") @@ -2008,7 +2014,6 @@ def test_download_plan_narrows_an_ltx23_pick_and_stages_its_extras(monkeypatch): def _cuda_bf16_target(monkeypatch): """Pretend the box can run layerwise fp8, so the pre-cast encoder resolves off-GPU.""" import torch - monkeypatch.setattr( "core.inference.video.resolve_diffusion_device_target", lambda: types.SimpleNamespace(device = "cuda", dtype = torch.bfloat16), @@ -2126,7 +2131,12 @@ def test_fetch_te_prequant_only_reports_what_it_downloaded(monkeypatch): kind = "repo", location = "unsloth/LTX-2-FP8", filename = "LTX-2-text_encoder-FP8.pt" ) - def _boom(repo, filename, token, cancel_event = None): + def _boom( + repo, + filename, + token, + cancel_event = None, + ): raise OSError("404") monkeypatch.setattr("utils.hf_xet_fallback.hf_hub_download_with_xet_fallback", _boom) @@ -2162,9 +2172,7 @@ def test_load_pipeline_tops_up_the_dense_encoder_when_injection_fails(fake_runti # Nothing was skipped -> no second pull. calls.clear() - backend.load_pipeline( - "Lightricks/LTX-2", model_kind = "pipeline", _base_local_dir = str(tmp_path) - ) + backend.load_pipeline("Lightricks/LTX-2", model_kind = "pipeline", _base_local_dir = str(tmp_path)) assert calls == [] backend.unload()