Skip to content

Commit 771d177

Browse files
authored
feat: add ModelScope message (#637)
Signed-off-by: Gaius <[email protected]>
1 parent 6289d02 commit 771d177

File tree

8 files changed

+437
-163
lines changed

8 files changed

+437
-163
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.22"
3+
version = "2.2.23"
44
authors = ["Gaius <[email protected]>"]
55
edition = "2021"
66
license = "Apache-2.0"

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

Lines changed: 227 additions & 147 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: 162 additions & 4 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: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,8 @@ message Download {
709709
bool enable_task_id_based_blob_digest = 30;
710710
// HuggingFace protocol information.
711711
optional HuggingFace hugging_face = 31;
712+
// ModelScope protocol information.
713+
optional ModelScope model_scope = 32;
712714

713715
reserved 21;
714716
reserved "load_to_cache";
@@ -770,11 +772,23 @@ message HuggingFace {
770772
min_len: 1
771773
ignore_empty: true
772774
}];
773-
// Insecure skip verify indicates whether to skip verifying the server's certificate chain.
774-
optional bool insecure_skip_verify = 2;
775775
// Revision of the HuggingFace model, dataset, or space. It can be a branch name, tag name, or commit hash. If not specified,
776776
// it defaults to the repository's default main branch.
777-
string revision = 3 [(validate.rules).string = {
777+
string revision = 2 [(validate.rules).string = {
778+
min_len: 1
779+
}];
780+
}
781+
782+
// ModelScope related information.
783+
message ModelScope {
784+
// Access token for ModelScope Hub.
785+
optional string token = 1 [(validate.rules).string = {
786+
min_len: 1
787+
ignore_empty: true
788+
}];
789+
// Revision of the ModelScope model, dataset, or space. It can be a branch name, tag name, or commit hash. If not specified,
790+
// it defaults to the repository's default main branch.
791+
string revision = 2 [(validate.rules).string = {
778792
min_len: 1
779793
}];
780794
}

proto/common.proto

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,8 @@ message Download {
651651
bool enable_task_id_based_blob_digest = 30;
652652
// HuggingFace protocol information.
653653
optional HuggingFace hugging_face = 31;
654+
// ModelScope protocol information.
655+
optional ModelScope model_scope = 32;
654656

655657
reserved 21;
656658
reserved "load_to_cache";
@@ -688,11 +690,18 @@ message HDFS {
688690
message HuggingFace {
689691
// Access token for HuggingFace Hub.
690692
optional string token = 1;
691-
// Insecure skip verify indicates whether to skip verifying the server's certificate chain.
692-
optional bool insecure_skip_verify = 2;
693693
// Revision of the HuggingFace model, dataset, or space. It can be a branch name, tag name, or commit hash. If not specified,
694694
// it defaults to the repository's default main branch.
695-
string revision = 3;
695+
string revision = 2;
696+
}
697+
698+
// ModelScope related information.
699+
message ModelScope {
700+
// Access token for ModelScope Hub.
701+
optional string token = 1;
702+
// Revision of the ModelScope model, dataset, or space. It can be a branch name, tag name, or commit hash. If not specified,
703+
// it defaults to the repository's default main branch.
704+
string revision = 2;
696705
}
697706

698707
// Range represents download range.

src/common.v2.rs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,9 @@ pub struct Download {
777777
/// HuggingFace protocol information.
778778
#[prost(message, optional, tag = "31")]
779779
pub hugging_face: ::core::option::Option<HuggingFace>,
780+
/// ModelScope protocol information.
781+
#[prost(message, optional, tag = "32")]
782+
pub model_scope: ::core::option::Option<ModelScope>,
780783
}
781784
/// Object Storage related information.
782785
#[derive(serde::Serialize, serde::Deserialize)]
@@ -828,12 +831,22 @@ pub struct HuggingFace {
828831
/// Access token for HuggingFace Hub.
829832
#[prost(string, optional, tag = "1")]
830833
pub token: ::core::option::Option<::prost::alloc::string::String>,
831-
/// Insecure skip verify indicates whether to skip verifying the server's certificate chain.
832-
#[prost(bool, optional, tag = "2")]
833-
pub insecure_skip_verify: ::core::option::Option<bool>,
834834
/// Revision of the HuggingFace model, dataset, or space. It can be a branch name, tag name, or commit hash. If not specified,
835835
/// it defaults to the repository's default main branch.
836-
#[prost(string, tag = "3")]
836+
#[prost(string, tag = "2")]
837+
pub revision: ::prost::alloc::string::String,
838+
}
839+
/// ModelScope related information.
840+
#[derive(serde::Serialize, serde::Deserialize)]
841+
#[allow(clippy::derive_partial_eq_without_eq)]
842+
#[derive(Clone, PartialEq, ::prost::Message)]
843+
pub struct ModelScope {
844+
/// Access token for ModelScope Hub.
845+
#[prost(string, optional, tag = "1")]
846+
pub token: ::core::option::Option<::prost::alloc::string::String>,
847+
/// Revision of the ModelScope model, dataset, or space. It can be a branch name, tag name, or commit hash. If not specified,
848+
/// it defaults to the repository's default main branch.
849+
#[prost(string, tag = "2")]
837850
pub revision: ::prost::alloc::string::String,
838851
}
839852
/// Range represents download range.

src/descriptor.bin

431 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)