Skip to content

Commit ecb34c9

Browse files
authored
feat: add Hugging Face protocol information (#623)
Signed-off-by: Gaius <gaius.qi@gmail.com>
1 parent e745487 commit ecb34c9

File tree

8 files changed

+435
-171
lines changed

8 files changed

+435
-171
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dragonfly-api"
3-
version = "2.2.16"
3+
version = "2.2.17"
44
authors = ["Gaius <gaius.qi@gmail.com>"]
55
edition = "2021"
66
license = "Apache-2.0"

pkg/apis/common/v2/common.pb.go

Lines changed: 251 additions & 169 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/common/v2/common.pb.validate.go

Lines changed: 151 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/common/v2/common.proto

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,8 @@ message Download {
703703
// registries - the same blob from different registries shares one task ID, eliminating redundant downloads
704704
// and storage.
705705
bool enable_task_id_based_blob_digest = 30;
706+
// HuggingFace protocol information.
707+
optional HuggingFace hugging_face = 31;
706708

707709
reserved 21;
708710
reserved "load_to_cache";
@@ -757,6 +759,15 @@ message HDFS {
757759
}];
758760
}
759761

762+
// HuggingFace related information.
763+
message HuggingFace {
764+
// Access token for HuggingFace Hub.
765+
optional string token = 1 [(validate.rules).string = {
766+
min_len: 1
767+
ignore_empty: true
768+
}];
769+
}
770+
760771
// Range represents download range.
761772
message Range {
762773
// Start of range.

proto/common.proto

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,8 @@ message Download {
645645
// registries - the same blob from different registries shares one task ID, eliminating redundant downloads
646646
// and storage.
647647
bool enable_task_id_based_blob_digest = 30;
648+
// HuggingFace protocol information.
649+
optional HuggingFace hugging_face = 31;
648650

649651
reserved 21;
650652
reserved "load_to_cache";
@@ -678,6 +680,12 @@ message HDFS {
678680
optional string delegation_token = 1;
679681
}
680682

683+
// HuggingFace related information.
684+
message HuggingFace {
685+
// Access token for HuggingFace Hub.
686+
optional string token = 1;
687+
}
688+
681689
// Range represents download range.
682690
message Range {
683691
// Start of range.

src/common.v2.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,9 @@ pub struct Download {
768768
/// and storage.
769769
#[prost(bool, tag = "30")]
770770
pub enable_task_id_based_blob_digest: bool,
771+
/// HuggingFace protocol information.
772+
#[prost(message, optional, tag = "31")]
773+
pub hugging_face: ::core::option::Option<HuggingFace>,
771774
}
772775
/// Object Storage related information.
773776
#[derive(serde::Serialize, serde::Deserialize)]
@@ -811,6 +814,15 @@ pub struct Hdfs {
811814
#[prost(string, optional, tag = "1")]
812815
pub delegation_token: ::core::option::Option<::prost::alloc::string::String>,
813816
}
817+
/// HuggingFace related information.
818+
#[derive(serde::Serialize, serde::Deserialize)]
819+
#[allow(clippy::derive_partial_eq_without_eq)]
820+
#[derive(Clone, PartialEq, ::prost::Message)]
821+
pub struct HuggingFace {
822+
/// Access token for HuggingFace Hub.
823+
#[prost(string, optional, tag = "1")]
824+
pub token: ::core::option::Option<::prost::alloc::string::String>,
825+
}
814826
/// Range represents download range.
815827
#[derive(serde::Serialize, serde::Deserialize)]
816828
#[allow(clippy::derive_partial_eq_without_eq)]

src/descriptor.bin

418 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)