[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2026-07-27 05:00:11 +00:00
commit 370195c702
2 changed files with 6 additions and 4 deletions

View file

@ -28,9 +28,7 @@ def _snapshot_dir_fallback(repo_id: str, cache_dir: Optional[str]) -> Optional[s
]
except OSError:
return None
candidates = [
rev for rev in revisions if os.path.isfile(os.path.join(rev, "config.json"))
]
candidates = [rev for rev in revisions if os.path.isfile(os.path.join(rev, "config.json"))]
if not candidates:
return None
return max(candidates, key = os.path.getmtime)

View file

@ -5152,7 +5152,11 @@ async def validate_model(
# Same audio gate as /load: non-GGUF audio models pull codec repos at
# load time, so a local-only candidate is rejected here before the
# frontend burns a load attempt on it.
if request.local_files_only and not getattr(config, "is_gguf", False) and getattr(config, "is_audio", False):
if (
request.local_files_only
and not getattr(config, "is_gguf", False)
and getattr(config, "is_audio", False)
):
raise HTTPException(
status_code = 409,
detail = (