[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
e2f41e4069
commit
72ec67034c
3 changed files with 5 additions and 12 deletions
|
|
@ -1006,6 +1006,7 @@ class DiffusionBackend:
|
|||
import re
|
||||
|
||||
exc_msg = re.sub(r"hf_[A-Za-z0-9]{20,}", "<redacted>", exc_msg)
|
||||
|
||||
# Round 17 P2 #9: diffusers / safetensors raise errors
|
||||
# like ``FileNotFoundError: /home/alice/models/foo.gguf``
|
||||
# or ``OSError: Error while loading state dict from
|
||||
|
|
|
|||
|
|
@ -344,9 +344,7 @@ async def _validation_error_scrubbing_handler(request, exc):
|
|||
# Path objects, Url instances, etc.) into JSON-safe primitives.
|
||||
return _JSONResponse(
|
||||
status_code = 422,
|
||||
content = _jsonable_encoder(
|
||||
{"detail": _scrub_validation_obj(exc.errors())}
|
||||
),
|
||||
content = _jsonable_encoder({"detail": _scrub_validation_obj(exc.errors())}),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -501,9 +501,7 @@ async def _release_export_for(workload: str) -> None:
|
|||
try:
|
||||
exp = get_export_backend()
|
||||
except Exception as exc:
|
||||
logger.warning(
|
||||
"Could not access export backend before %s: %s", workload, exc
|
||||
)
|
||||
logger.warning("Could not access export backend before %s: %s", workload, exc)
|
||||
raise HTTPException(
|
||||
status_code = 503,
|
||||
detail = (
|
||||
|
|
@ -537,9 +535,7 @@ async def _release_export_for(workload: str) -> None:
|
|||
)
|
||||
await asyncio.to_thread(exp._shutdown_subprocess)
|
||||
except Exception as exc:
|
||||
logger.warning(
|
||||
"Could not shut down export for %s: %s", workload, exc
|
||||
)
|
||||
logger.warning("Could not shut down export for %s: %s", workload, exc)
|
||||
raise HTTPException(
|
||||
status_code = 503,
|
||||
detail = (
|
||||
|
|
@ -573,9 +569,7 @@ async def _release_diffusion_for(workload: str) -> None:
|
|||
try:
|
||||
diff_status = diff_backend.status()
|
||||
except Exception as exc:
|
||||
logger.warning(
|
||||
"Could not verify diffusion status before %s: %s", workload, exc
|
||||
)
|
||||
logger.warning("Could not verify diffusion status before %s: %s", workload, exc)
|
||||
raise HTTPException(
|
||||
status_code = 503,
|
||||
detail = (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue