diff --git a/studio/backend/core/inference/diffusion.py b/studio/backend/core/inference/diffusion.py index fe50588b61..20d67a9cf3 100644 --- a/studio/backend/core/inference/diffusion.py +++ b/studio/backend/core/inference/diffusion.py @@ -1506,7 +1506,9 @@ def _release_chat_backend_for_diffusion() -> None: # owned names. Catches races where a name we did not explicitly # unload (because it appeared in loading_models between the # snapshot and the unload calls) is still owned after the loop. - remaining_loading = set(getattr(backend, "loading_models", set()) or set()) & owned_names + remaining_loading = ( + set(getattr(backend, "loading_models", set()) or set()) & owned_names + ) remaining_active = getattr(backend, "active_model_name", None) if remaining_loading or (remaining_active in owned_names): raise RuntimeError( diff --git a/studio/backend/routes/inference.py b/studio/backend/routes/inference.py index b20e7e3696..7d18972a91 100644 --- a/studio/backend/routes/inference.py +++ b/studio/backend/routes/inference.py @@ -506,7 +506,9 @@ async def _release_safetensors_chat_for(workload: str) -> None: # initially present. Catches races where a model name we did not # explicitly unload (because it appeared between the snapshot and # the unload calls) is still in the owned set after the loop. - remaining_loading = set(getattr(inf, "loading_models", set()) or set()) & owned_names + remaining_loading = ( + set(getattr(inf, "loading_models", set()) or set()) & owned_names + ) remaining_active = getattr(inf, "active_model_name", None) if remaining_loading or (remaining_active in owned_names): raise HTTPException(