HfHub.Constants (HfHub v0.2.0)

Copy Markdown View Source

Constants for HuggingFace Hub operations.

Provides file names, headers, timeouts, and other constants matching Python's huggingface_hub.constants module.

Summary

Functions

Model configuration filename

Default timeout for downloads

Default HuggingFace Hub endpoint

Default timeout for ETag requests

Default timeout for general requests

Default git revision

Download chunk size (10 MB)

Flax/JAX model weights filename

Header for linked ETag

Header for linked file size

Header for commit hash in responses

PyTorch model weights filename

Separator used in repo IDs for cache directories

Dataset repository type

Model repository type

Space repository type

Returns the URL prefix for a repository type.

All supported repository types

Repository README card filename

Safetensors index file for sharded models

Maximum safetensors header length (25 MB)

Safetensors single file model

TensorFlow 2.x model weights filename

Functions

config_name()

@spec config_name() :: String.t()

Model configuration filename

default_download_timeout()

@spec default_download_timeout() :: pos_integer()

Default timeout for downloads

default_endpoint()

@spec default_endpoint() :: String.t()

Default HuggingFace Hub endpoint

default_etag_timeout()

@spec default_etag_timeout() :: pos_integer()

Default timeout for ETag requests

default_request_timeout()

@spec default_request_timeout() :: pos_integer()

Default timeout for general requests

default_revision()

@spec default_revision() :: String.t()

Default git revision

download_chunk_size()

@spec download_chunk_size() :: pos_integer()

Download chunk size (10 MB)

flax_weights_name()

@spec flax_weights_name() :: String.t()

Flax/JAX model weights filename

header_x_linked_etag()

@spec header_x_linked_etag() :: String.t()

Header for linked ETag

header_x_linked_size()

@spec header_x_linked_size() :: String.t()

Header for linked file size

header_x_repo_commit()

@spec header_x_repo_commit() :: String.t()

Header for commit hash in responses

pytorch_weights_name()

@spec pytorch_weights_name() :: String.t()

PyTorch model weights filename

repo_id_separator()

@spec repo_id_separator() :: String.t()

Separator used in repo IDs for cache directories

repo_type_dataset()

@spec repo_type_dataset() :: String.t()

Dataset repository type

repo_type_model()

@spec repo_type_model() :: String.t()

Model repository type

repo_type_space()

@spec repo_type_space() :: String.t()

Space repository type

repo_type_url_prefix(atom)

@spec repo_type_url_prefix(:model | :dataset | :space) :: String.t()

Returns the URL prefix for a repository type.

Models have no prefix; datasets use "datasets/"; spaces use "spaces/".

repo_types()

@spec repo_types() :: [:model | :dataset | :space]

All supported repository types

repocard_name()

@spec repocard_name() :: String.t()

Repository README card filename

safetensors_index_file()

@spec safetensors_index_file() :: String.t()

Safetensors index file for sharded models

safetensors_max_header_length()

@spec safetensors_max_header_length() :: pos_integer()

Maximum safetensors header length (25 MB)

safetensors_single_file()

@spec safetensors_single_file() :: String.t()

Safetensors single file model

tf2_weights_name()

@spec tf2_weights_name() :: String.t()

TensorFlow 2.x model weights filename