rebase.HuggingFacePublishConfig

Configure Hugging Face publication during model deployment.

Signature

class rebase.HuggingFacePublishConfig(
    repo_id: str,
    *,
    private: bool = True,
    repo_type: str = "model",
    artifact_path: str | pathlib.Path | None = None,
    path_in_repo: str | None = None,
    revision: str = "main",
    token: str | None = None,
    create_repo: bool = True,
    include_source: bool = True,
    sync_source_git: bool = True,
    allow_patterns: str | list[str] | None = None,
    ignore_patterns: str | list[str] | None = None,
    delete_patterns: str | list[str] | None = None,
    commit_message: str | None = None,
)

Parameters

ParameterTypeDescription
repo_idstrHugging Face namespace/name, for example rebase/add-numbers.
privateboolCreate the repo as private when it does not already exist. Set False for public open-source publication.
repo_typestrmodel or dataset.
artifact_path`strPath
path_in_repo`strNone`
revisionstrHub branch or revision to publish to, default main.
token`strNone`
sync_source_gitboolRecord a matching source Git commit on the Rebase publication when the model version has clean Git metadata. Publication still works when Git metadata is absent or dirty.

Example

model.deploy(
    huggingface=rebase.HuggingFacePublishConfig(
        repo_id="rebase/add-numbers",
        private=False,
        artifact_path="./artifacts/add-numbers",
    ),
)

On this page