HfHub.LFS (HfHub v0.2.0)

Copy Markdown View Source

LFS (Large File Storage) utilities for HuggingFace Hub.

Provides functionality for calculating file hashes and preparing upload information for the LFS protocol.

Based on Python's huggingface_hub.lfs module.

Summary

Functions

Returns the standard LFS headers for API requests.

Returns the LFS OID (object identifier) for upload info.

Converts UploadInfo sha256 to lowercase hex string.

Functions

lfs_headers()

@spec lfs_headers() :: [{String.t(), String.t()}]

Returns the standard LFS headers for API requests.

oid(info)

@spec oid(HfHub.LFS.UploadInfo.t()) :: String.t()

Returns the LFS OID (object identifier) for upload info.

The OID is the lowercase hex representation of the SHA256 hash.

sha256_hex(upload_info)

@spec sha256_hex(HfHub.LFS.UploadInfo.t()) :: String.t()

Converts UploadInfo sha256 to lowercase hex string.