Skip to content

feat(api): add revision field to HuggingFace model#633

Merged
gaius-qi merged 1 commit intomainfrom
feat/revision
Mar 5, 2026
Merged

feat(api): add revision field to HuggingFace model#633
gaius-qi merged 1 commit intomainfrom
feat/revision

Conversation

@gaius-qi
Copy link
Member

@gaius-qi gaius-qi commented Mar 5, 2026

Description

This pull request adds support for specifying a revision field in the HuggingFace configuration, allowing users to select a specific branch, tag, or commit hash for models, datasets, or spaces. The field is optional and defaults to the repository's main branch if not specified. Validation is enforced to ensure that, if provided, the revision string is at least one character long.

HuggingFace Revision Support

  • Added an optional revision field to the HuggingFace message in proto/common.proto and pkg/apis/common/v2/common.proto, with documentation and validation rules requiring a minimum length of one character if present. [1] [2]
  • Updated the generated Go (pkg/apis/common/v2/common.pb.go) and Rust (src/common.v2.rs) code to include the new revision field, getter method, and serialization/deserialization support. [1] [2] [3]
  • Implemented validation logic in pkg/apis/common/v2/common.pb.validate.go to enforce the minimum length rule for the revision field.
  • Modified the raw protobuf descriptor in pkg/apis/common/v2/common.pb.go to reflect the new field and its metadata.

Versioning

  • Bumped the crate version in Cargo.toml from 2.2.20 to 2.2.21 to reflect the new feature addition.

Related Issue

Motivation and Context

Signed-off-by: Gaius <gaius.qi@gmail.com>
@gaius-qi gaius-qi self-assigned this Mar 5, 2026
@gaius-qi gaius-qi added the enhancement New feature or request label Mar 5, 2026
@gaius-qi gaius-qi enabled auto-merge (squash) March 5, 2026 14:26
@gaius-qi gaius-qi merged commit f8d1ee5 into main Mar 5, 2026
6 checks passed
@gaius-qi gaius-qi deleted the feat/revision branch March 5, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants