Skip to content

Commit

Permalink
fix(abstractions): misspec of stdout/stderr under LOUD_BACKEND
Browse files Browse the repository at this point in the history
  • Loading branch information
TianyiQ committed Dec 6, 2024
1 parent 68fbaeb commit 1aefe97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/download_models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from src.path import root
import subprocess, os, sys
import subprocess, os


def download_model(model_name: str, save_path: str):
Expand All @@ -8,8 +8,8 @@ def download_model(model_name: str, save_path: str):
with open(os.devnull, "w") as devnull:
process = subprocess.Popen(
["huggingface-cli", "download", model_name, "--local-dir", save_path],
stdout=(devnull if not eval(os.environ.get("LOUD_BACKEND", "False")) else sys.stdout),
stderr=(devnull if not eval(os.environ.get("LOUD_BACKEND", "False")) else sys.stderr),
stdout=(devnull if not eval(os.environ.get("LOUD_BACKEND", "False")) else None),
stderr=(devnull if not eval(os.environ.get("LOUD_BACKEND", "False")) else None),
)
process.wait()

Expand Down

0 comments on commit 1aefe97

Please sign in to comment.