From db05a9883b59f7dfddf44e09b06d0ee000715497 Mon Sep 17 00:00:00 2001 From: Lucain Date: Fri, 12 Jul 2024 13:18:43 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Julien Chaumond --- src/huggingface_hub/_commit_api.py | 2 +- src/huggingface_hub/utils/sha.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/huggingface_hub/_commit_api.py b/src/huggingface_hub/_commit_api.py index f005474c49..ba0cfce238 100644 --- a/src/huggingface_hub/_commit_api.py +++ b/src/huggingface_hub/_commit_api.py @@ -260,7 +260,7 @@ def _local_oid(self) -> Optional[str]: For LFS files, the OID corresponds to the SHA256 of the file content (used a LFS ref). For regular files, the OID corresponds to the SHA1 of the file content. - Note: this is slightly different to git OID computation since the oid of an LFS file is usually the SHA1 of the + Note: this is slightly different to git OID computation since the oid of an LFS file is usually the git-SHA1 of the pointer file content (not the actual file content). However, using the SHA256 is enough to detect changes and more convenient client-side. """ diff --git a/src/huggingface_hub/utils/sha.py b/src/huggingface_hub/utils/sha.py index cd3055c416..001c3fe8b2 100644 --- a/src/huggingface_hub/utils/sha.py +++ b/src/huggingface_hub/utils/sha.py @@ -31,7 +31,7 @@ def sha_fileobj(fileobj: BinaryIO, chunk_size: Optional[int] = None) -> bytes: def git_hash(data: bytes) -> str: """ - Computes the sha1 hash of the given bytes, using the same algorithm as git. + Computes the git-sha1 hash of the given bytes, using the same algorithm as git. This is equivalent to running `git hash-object`. See https://git-scm.com/docs/git-hash-object for more details.