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

Remove legacy helper 'install_lfs_in_userspace' #1059

Merged
merged 1 commit into from
Sep 16, 2022
Merged
Changes from all commits
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
20 changes: 0 additions & 20 deletions src/huggingface_hub/lfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import io
import os
import re
import subprocess
import sys
from contextlib import AbstractContextManager
from dataclasses import dataclass
from math import ceil
Expand All @@ -36,24 +34,6 @@

LFS_MULTIPART_UPLOAD_COMMAND = "lfs-multipart-upload"


def install_lfs_in_userspace():
"""
If in Linux, installs git-lfs in userspace (sometimes useful if you can't
`sudo apt install` or equivalent).
"""
if sys.platform != "linux":
raise ValueError("Only implemented for Linux right now")
GIT_LFS_TARBALL = "https://github.com/git-lfs/git-lfs/releases/download/v2.13.1/git-lfs-linux-amd64-v2.13.1.tar.gz"
CWD = os.path.join(os.getcwd(), "install_lfs")
os.makedirs(CWD, exist_ok=True)
subprocess.run(
["wget", "-O", "tarball.tar.gz", GIT_LFS_TARBALL], check=True, cwd=CWD
)
subprocess.run(["tar", "-xvzf", "tarball.tar.gz"], check=True, cwd=CWD)
subprocess.run(["bash", "install.sh"], check=True, cwd=CWD)


LFS_HEADERS = {
"Accept": "application/vnd.git-lfs+json",
"Content-Type": "application/vnd.git-lfs+json",
Expand Down