Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add git lfs install instructions #298

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions python/mlcroissant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ All tests can be run from the Makefile:
make tests
```

Note that `git lfs` should be installed to successfully pass all tests:

```bash
git lfs install
```

## Design

The most important modules in the library are:
Expand Down
7 changes: 6 additions & 1 deletion python/mlcroissant/mlcroissant/_src/core/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,9 @@ def download_git_lfs_file(file: Path):
logging.info(
"Downloading git-lfs file: %s in working dir: %s", fullpath, working_dir
)
repo.execute(["git", "lfs", "pull", "--include", fullpath])
try:
repo.execute(["git", "lfs", "pull", "--include", fullpath])
except deps.git.exc.GitCommandError as ex:
if ("You called a Git command named 'lfs', which does not exist."
in ex.stderr):
raise RuntimeError("git lfs is not installed!") from ex
mkuchnik marked this conversation as resolved.
Show resolved Hide resolved
Loading