chore: ruff

This commit is contained in:
psychedelicious
2024-03-01 10:04:59 +11:00
parent ad86b29798
commit dd9daf8efb
44 changed files with 51 additions and 19 deletions

View File

@ -1,6 +1,7 @@
"""
Initialization file for invokeai.backend.util
"""
from .attention import auto_detect_slice_size # noqa: F401
from .devices import ( # noqa: F401
CPU_DEVICE,

View File

@ -3,6 +3,7 @@
Utility routine used for autodetection of optimal slice size
for attention mechanism.
"""
import psutil
import torch

View File

@ -1,4 +1,5 @@
"""Context class to silence transformers and diffusers warnings."""
import warnings
from typing import Any

View File

@ -340,14 +340,17 @@ def download_with_resume(url: str, dest: Path, access_token: str = None) -> Path
logger.error(f"ERROR DOWNLOADING {url}: {resp.text}")
return None
with open(dest, open_mode) as file, tqdm(
desc=str(dest),
initial=exist_size,
total=content_length,
unit="iB",
unit_scale=True,
unit_divisor=1000,
) as bar:
with (
open(dest, open_mode) as file,
tqdm(
desc=str(dest),
initial=exist_size,
total=content_length,
unit="iB",
unit_scale=True,
unit_divisor=1000,
) as bar,
):
for data in resp.iter_content(chunk_size=1024):
size = file.write(data)
bar.update(size)