Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
LysandreJik committed Oct 5, 2021
1 parent cb75fb8 commit 9da3c09
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/huggingface_hub/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ def clone_from(self, repo_url: str, use_auth_token: Union[bool, str, None] = Non
# For error messages, it's cleaner to show the repo url without the token.
clean_repo_url = re.sub(r"https://.*@", "https://", repo_url)
try:
run_subprocess("git lfs install", self.local_dir)
run_subprocess("git lfs install".split(), self.local_dir)

# checks if repository is initialized in a empty repository or in one with files
if len(os.listdir(self.local_dir)) == 0:
Expand Down
9 changes: 9 additions & 0 deletions src/huggingface_hub/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,17 @@

import subprocess

from .logging import get_logger


logger = get_logger(__name__)


def run_subprocess(command, folder, check=True) -> subprocess.CompletedProcess:
if isinstance(command, str):
logger.error("`run_subprocess` should be called with a list of strings.")
command = command.split()

return subprocess.run(
command,
stderr=subprocess.PIPE,
Expand Down

0 comments on commit 9da3c09

Please sign in to comment.