[diffusion] feat: add performance mode server args (#24491)

This commit is contained in:
Mick
2026-05-14 00:57:46 +08:00
committed by GitHub
parent e2290b155a
commit ff70aeac30
79 changed files with 1734 additions and 532 deletions
+10 -7
View File
@@ -426,13 +426,16 @@ def download_and_cache_file(url: str, filename: Optional[str] = None):
chunk_size = 1024 # Download in chunks of 1KB
# Use tqdm to display the progress bar
with open(filename, "wb") as f, tqdm(
desc=filename,
total=total_size,
unit="B",
unit_scale=True,
unit_divisor=1024,
) as bar:
with (
open(filename, "wb") as f,
tqdm(
desc=filename,
total=total_size,
unit="B",
unit_scale=True,
unit_divisor=1024,
) as bar,
):
for chunk in response.iter_content(chunk_size=chunk_size):
f.write(chunk)
bar.update(len(chunk))