Voice et bot modif
This commit is contained in:
parent
189d56026b
commit
7333a22bcd
10774 changed files with 634644 additions and 933308 deletions
|
|
@ -11,7 +11,7 @@ Spec is: github.com/git-lfs/git-lfs/blob/master/docs/custom-transfers.md
|
|||
To launch debugger while developing:
|
||||
|
||||
``` [lfs "customtransfer.multipart"]
|
||||
path = /path/to/huggingface_hub/.env/bin/python args = -m debugpy --listen 5678
|
||||
path = /path/to/huggingface_hub/.venv/bin/python args = -m debugpy --listen 5678
|
||||
--wait-for-client
|
||||
/path/to/huggingface_hub/src/huggingface_hub/commands/huggingface_cli.py
|
||||
lfs-multipart-upload ```"""
|
||||
|
|
@ -20,14 +20,16 @@ import json
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from typing import Annotated, Optional
|
||||
from typing import Annotated
|
||||
|
||||
import typer
|
||||
|
||||
from huggingface_hub.errors import CLIError
|
||||
from huggingface_hub.lfs import LFS_MULTIPART_UPLOAD_COMMAND
|
||||
|
||||
from ..utils import get_session, hf_raise_for_status, logging
|
||||
from ..utils._lfs import SliceFileObj
|
||||
from ._output import out
|
||||
|
||||
|
||||
logger = logging.get_logger(__name__)
|
||||
|
|
@ -42,15 +44,14 @@ def lfs_enable_largefiles(
|
|||
],
|
||||
) -> None:
|
||||
"""
|
||||
Configure a local git repository to use the multipart transfer agent for large files.
|
||||
Configure your repository to enable upload of files > 5GB.
|
||||
|
||||
This command sets up git-lfs to use the custom multipart transfer agent
|
||||
which enables efficient uploading of large files in chunks.
|
||||
"""
|
||||
local_path = os.path.abspath(path)
|
||||
if not os.path.isdir(local_path):
|
||||
print("This does not look like a valid git repo.")
|
||||
raise typer.Exit(code=1)
|
||||
raise CLIError("This does not look like a valid git repo.")
|
||||
subprocess.run(
|
||||
"git config lfs.customtransfer.multipart.path hf".split(),
|
||||
check=True,
|
||||
|
|
@ -61,7 +62,7 @@ def lfs_enable_largefiles(
|
|||
check=True,
|
||||
cwd=local_path,
|
||||
)
|
||||
print("Local repo set up for largefiles")
|
||||
out.result("Local repo set up for largefiles", path=local_path)
|
||||
|
||||
|
||||
def write_msg(msg: dict):
|
||||
|
|
@ -71,7 +72,7 @@ def write_msg(msg: dict):
|
|||
sys.stdout.flush()
|
||||
|
||||
|
||||
def read_msg() -> Optional[dict]:
|
||||
def read_msg() -> dict | None:
|
||||
"""Read Line delimited JSON from stdin."""
|
||||
msg = json.loads(sys.stdin.readline().strip())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue