diff --git a/studio/backend/core/inference/diffusion.py b/studio/backend/core/inference/diffusion.py index 16683b4b6e..fa3e168c48 100644 --- a/studio/backend/core/inference/diffusion.py +++ b/studio/backend/core/inference/diffusion.py @@ -809,7 +809,6 @@ class DiffusionBackend: def _hub_cache_repo_dir(repo_id: str) -> Path: """The local HF hub cache dir for ``repo_id`` (``.../models--org--name``).""" from huggingface_hub import constants - return Path(constants.HF_HUB_CACHE) / f"models--{repo_id.replace('/', '--')}" @staticmethod @@ -1448,9 +1447,7 @@ class DiffusionBackend: # expansion. The single-file-is-pipeline (SDXL) path is a full bf16 pipeline # checkpoint, not this fp8 transformer path, so it stays at on-disk size. fp8_upcast = not getattr(fam, "single_file_is_pipeline", False) and ( - "fp8" in Path(single_file_path).name.lower() - if single_file_path - else False + "fp8" in Path(single_file_path).name.lower() if single_file_path else False ) transformer_resident = estimate_safetensors_dense_mib( file_size_mib(single_file_path), fp8_upcast = fp8_upcast diff --git a/studio/backend/tests/test_diffusion_training.py b/studio/backend/tests/test_diffusion_training.py index 92429d60f8..2cff7f65c3 100644 --- a/studio/backend/tests/test_diffusion_training.py +++ b/studio/backend/tests/test_diffusion_training.py @@ -492,7 +492,9 @@ def test_diffusion_dataset_upload_rejects_unsupported_files(client, dataset_root assert "Unsupported file" in r.json()["detail"] -def test_diffusion_dataset_upload_over_cap_rolls_back_whole_batch(client, dataset_roots, monkeypatch): +def test_diffusion_dataset_upload_over_cap_rolls_back_whole_batch( + client, dataset_roots, monkeypatch +): # All-or-nothing: a valid image ahead of the one that trips the size cap must NOT be # left on disk (the 413 mid-batch rolls back every file written this request). import utils.upload_limits as ul