#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TuningError {
#[prost(string, tag = "1")]
pub tuning_task_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
#[prost(enumeration = "tuning_error::Type", tag = "3")]
pub r#type: i32,
}
pub mod tuning_error {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Type {
Unspecified = 0,
Public = 1,
Internal = 2,
}
impl Type {
pub fn as_str_name(&self) -> &'static str {
match self {
Type::Unspecified => "TYPE_UNSPECIFIED",
Type::Public => "PUBLIC",
Type::Internal => "INTERNAL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"PUBLIC" => Some(Self::Public),
"INTERNAL" => Some(Self::Internal),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OptimizerAdamw {
#[prost(double, tag = "1")]
pub beta1: f64,
#[prost(double, tag = "2")]
pub beta2: f64,
#[prost(double, tag = "3")]
pub eps: f64,
#[prost(double, tag = "4")]
pub weight_decay: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SchedulerLinear {
#[prost(double, tag = "1")]
pub min_lr: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SchedulerConstant {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SchedulerCosine {
#[prost(double, tag = "1")]
pub min_lr: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TuningTask {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub operation_id: ::prost::alloc::string::String,
#[prost(enumeration = "tuning_task::Status", tag = "4")]
pub status: i32,
#[prost(string, tag = "5")]
pub folder_id: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub created_by: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "8")]
pub started_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "9")]
pub finished_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "10")]
pub source_model_uri: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub target_model_uri: ::prost::alloc::string::String,
#[prost(string, tag = "12")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "13")]
pub description: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "14")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
pub mod tuning_task {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Status {
Unspecified = 0,
Created = 1,
Pending = 2,
InProgress = 3,
Completed = 4,
Failed = 5,
Canceled = 6,
Draft = 7,
}
impl Status {
pub fn as_str_name(&self) -> &'static str {
match self {
Status::Unspecified => "STATUS_UNSPECIFIED",
Status::Created => "CREATED",
Status::Pending => "PENDING",
Status::InProgress => "IN_PROGRESS",
Status::Completed => "COMPLETED",
Status::Failed => "FAILED",
Status::Canceled => "CANCELED",
Status::Draft => "DRAFT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"CREATED" => Some(Self::Created),
"PENDING" => Some(Self::Pending),
"IN_PROGRESS" => Some(Self::InProgress),
"COMPLETED" => Some(Self::Completed),
"FAILED" => Some(Self::Failed),
"CANCELED" => Some(Self::Canceled),
"DRAFT" => Some(Self::Draft),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TuningTypeLora {
#[prost(int64, tag = "1")]
pub rank: i64,
#[prost(double, tag = "2")]
pub alpha: f64,
#[prost(string, tag = "3")]
pub initialization: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub r#type: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TuningTypePromptTune {
#[prost(int64, tag = "1")]
pub virtual_tokens: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTuningsRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub page_size: i64,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
#[prost(enumeration = "tuning_task::Status", tag = "4")]
pub status: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTuningsResponse {
#[prost(message, repeated, tag = "1")]
pub tuning_tasks: ::prost::alloc::vec::Vec<TuningTask>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DescribeTuningRequest {
#[prost(string, tag = "1")]
pub tuning_task_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DescribeTuningResponse {
#[prost(message, optional, tag = "1")]
pub tuning_task: ::core::option::Option<TuningTask>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelTuningRequest {
#[prost(string, tag = "1")]
pub tuning_task_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelTuningResponse {
#[prost(string, tag = "1")]
pub tuning_task_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TuningResponse {
#[prost(string, tag = "3")]
pub tuning_task_id: ::prost::alloc::string::String,
#[prost(enumeration = "tuning_task::Status", tag = "4")]
pub status: i32,
#[prost(string, tag = "5")]
pub target_model_uri: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TuningMetadata {
#[prost(string, tag = "1")]
pub tuning_task_id: ::prost::alloc::string::String,
#[prost(enumeration = "tuning_task::Status", tag = "2")]
pub status: i32,
#[prost(int64, tag = "3")]
pub total_steps: i64,
#[prost(int64, tag = "4")]
pub current_step: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TuningRequest {
#[prost(string, tag = "1")]
pub base_model_uri: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub train_datasets: ::prost::alloc::vec::Vec<tuning_request::WeightedDataset>,
#[prost(message, repeated, tag = "3")]
pub validation_datasets: ::prost::alloc::vec::Vec<tuning_request::WeightedDataset>,
#[prost(string, tag = "200")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "201")]
pub description: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "202")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(oneof = "tuning_request::TuningParams", tags = "100, 101, 102, 103, 104")]
pub tuning_params: ::core::option::Option<tuning_request::TuningParams>,
}
pub mod tuning_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WeightedDataset {
#[prost(string, tag = "1")]
pub dataset_id: ::prost::alloc::string::String,
#[prost(double, tag = "2")]
pub weight: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum TuningParams {
#[prost(message, tag = "100")]
TextToTextCompletion(super::TextToTextCompletionTuningParams),
#[prost(message, tag = "101")]
TextClassificationMultilabel(super::TextClassificationMultilabelParams),
#[prost(message, tag = "102")]
TextClassificationMulticlass(super::TextClassificationMulticlassParams),
#[prost(message, tag = "103")]
TextEmbeddingPairParams(super::TextEmbeddingPairParams),
#[prost(message, tag = "104")]
TextEmbeddingTripletParams(super::TextEmbeddingTripletParams),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextToTextCompletionTuningParams {
#[prost(int64, tag = "1")]
pub seed: i64,
#[prost(double, tag = "2")]
pub lr: f64,
#[prost(int64, tag = "3")]
pub n_samples: i64,
#[prost(string, tag = "7")]
pub additional_arguments: ::prost::alloc::string::String,
#[prost(message, optional, tag = "200")]
pub scheduler: ::core::option::Option<
text_to_text_completion_tuning_params::Scheduler,
>,
#[prost(message, optional, tag = "201")]
pub optimizer: ::core::option::Option<
text_to_text_completion_tuning_params::Optimizer,
>,
#[prost(
oneof = "text_to_text_completion_tuning_params::TuningType",
tags = "100, 101"
)]
pub tuning_type: ::core::option::Option<
text_to_text_completion_tuning_params::TuningType,
>,
}
pub mod text_to_text_completion_tuning_params {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Scheduler {
#[prost(double, tag = "101")]
pub warmup_ratio: f64,
#[prost(oneof = "scheduler::Type", tags = "1, 2, 3")]
pub r#type: ::core::option::Option<scheduler::Type>,
}
pub mod scheduler {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Type {
#[prost(message, tag = "1")]
Linear(super::super::SchedulerLinear),
#[prost(message, tag = "2")]
Constant(super::super::SchedulerConstant),
#[prost(message, tag = "3")]
Cosine(super::super::SchedulerCosine),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Optimizer {
#[prost(oneof = "optimizer::Type", tags = "1")]
pub r#type: ::core::option::Option<optimizer::Type>,
}
pub mod optimizer {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Type {
#[prost(message, tag = "1")]
Adamw(super::super::OptimizerAdamw),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum TuningType {
#[prost(message, tag = "100")]
Lora(super::TuningTypeLora),
#[prost(message, tag = "101")]
PromptTune(super::TuningTypePromptTune),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextClassificationMultilabelParams {
#[prost(int64, tag = "1")]
pub seed: i64,
#[prost(double, tag = "2")]
pub lr: f64,
#[prost(int64, tag = "3")]
pub n_samples: i64,
#[prost(string, tag = "7")]
pub additional_arguments: ::prost::alloc::string::String,
#[prost(message, optional, tag = "200")]
pub scheduler: ::core::option::Option<
text_classification_multilabel_params::Scheduler,
>,
#[prost(message, optional, tag = "201")]
pub optimizer: ::core::option::Option<
text_classification_multilabel_params::Optimizer,
>,
#[prost(
oneof = "text_classification_multilabel_params::TuningType",
tags = "100, 101"
)]
pub tuning_type: ::core::option::Option<
text_classification_multilabel_params::TuningType,
>,
}
pub mod text_classification_multilabel_params {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Scheduler {
#[prost(double, tag = "101")]
pub warmup_ratio: f64,
#[prost(oneof = "scheduler::Type", tags = "1, 2, 3")]
pub r#type: ::core::option::Option<scheduler::Type>,
}
pub mod scheduler {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Type {
#[prost(message, tag = "1")]
Linear(super::super::SchedulerLinear),
#[prost(message, tag = "2")]
Constant(super::super::SchedulerConstant),
#[prost(message, tag = "3")]
Cosine(super::super::SchedulerCosine),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Optimizer {
#[prost(oneof = "optimizer::Type", tags = "1")]
pub r#type: ::core::option::Option<optimizer::Type>,
}
pub mod optimizer {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Type {
#[prost(message, tag = "1")]
Adamw(super::super::OptimizerAdamw),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum TuningType {
#[prost(message, tag = "100")]
Lora(super::TuningTypeLora),
#[prost(message, tag = "101")]
PromptTune(super::TuningTypePromptTune),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextClassificationMulticlassParams {
#[prost(int64, tag = "1")]
pub seed: i64,
#[prost(double, tag = "2")]
pub lr: f64,
#[prost(int64, tag = "3")]
pub n_samples: i64,
#[prost(string, tag = "7")]
pub additional_arguments: ::prost::alloc::string::String,
#[prost(message, optional, tag = "200")]
pub scheduler: ::core::option::Option<
text_classification_multiclass_params::Scheduler,
>,
#[prost(message, optional, tag = "201")]
pub optimizer: ::core::option::Option<
text_classification_multiclass_params::Optimizer,
>,
#[prost(
oneof = "text_classification_multiclass_params::TuningType",
tags = "100, 101"
)]
pub tuning_type: ::core::option::Option<
text_classification_multiclass_params::TuningType,
>,
}
pub mod text_classification_multiclass_params {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Scheduler {
#[prost(double, tag = "101")]
pub warmup_ratio: f64,
#[prost(oneof = "scheduler::Type", tags = "1, 2, 3")]
pub r#type: ::core::option::Option<scheduler::Type>,
}
pub mod scheduler {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Type {
#[prost(message, tag = "1")]
Linear(super::super::SchedulerLinear),
#[prost(message, tag = "2")]
Constant(super::super::SchedulerConstant),
#[prost(message, tag = "3")]
Cosine(super::super::SchedulerCosine),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Optimizer {
#[prost(oneof = "optimizer::Type", tags = "1")]
pub r#type: ::core::option::Option<optimizer::Type>,
}
pub mod optimizer {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Type {
#[prost(message, tag = "1")]
Adamw(super::super::OptimizerAdamw),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum TuningType {
#[prost(message, tag = "100")]
Lora(super::TuningTypeLora),
#[prost(message, tag = "101")]
PromptTune(super::TuningTypePromptTune),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextEmbeddingPairParams {
#[prost(int64, tag = "1")]
pub seed: i64,
#[prost(double, tag = "2")]
pub lr: f64,
#[prost(int64, tag = "3")]
pub n_samples: i64,
#[prost(string, tag = "7")]
pub additional_arguments: ::prost::alloc::string::String,
#[prost(int64, repeated, tag = "8")]
pub embedding_dims: ::prost::alloc::vec::Vec<i64>,
#[prost(message, optional, tag = "200")]
pub scheduler: ::core::option::Option<text_embedding_pair_params::Scheduler>,
#[prost(message, optional, tag = "201")]
pub optimizer: ::core::option::Option<text_embedding_pair_params::Optimizer>,
#[prost(oneof = "text_embedding_pair_params::TuningType", tags = "100, 101")]
pub tuning_type: ::core::option::Option<text_embedding_pair_params::TuningType>,
}
pub mod text_embedding_pair_params {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Scheduler {
#[prost(oneof = "scheduler::Type", tags = "1, 2, 3")]
pub r#type: ::core::option::Option<scheduler::Type>,
#[prost(oneof = "scheduler::OptionalWarmupRatio", tags = "101")]
pub optional_warmup_ratio: ::core::option::Option<
scheduler::OptionalWarmupRatio,
>,
}
pub mod scheduler {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Type {
#[prost(message, tag = "1")]
Linear(super::super::SchedulerLinear),
#[prost(message, tag = "2")]
Constant(super::super::SchedulerConstant),
#[prost(message, tag = "3")]
Cosine(super::super::SchedulerCosine),
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum OptionalWarmupRatio {
#[prost(double, tag = "101")]
WarmupRatio(f64),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Optimizer {
#[prost(oneof = "optimizer::Type", tags = "1")]
pub r#type: ::core::option::Option<optimizer::Type>,
}
pub mod optimizer {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Type {
#[prost(message, tag = "1")]
Adamw(super::super::OptimizerAdamw),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum TuningType {
#[prost(message, tag = "100")]
Lora(super::TuningTypeLora),
#[prost(message, tag = "101")]
PromptTune(super::TuningTypePromptTune),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextEmbeddingTripletParams {
#[prost(int64, tag = "1")]
pub seed: i64,
#[prost(double, tag = "2")]
pub lr: f64,
#[prost(int64, tag = "3")]
pub n_samples: i64,
#[prost(string, tag = "7")]
pub additional_arguments: ::prost::alloc::string::String,
#[prost(int64, repeated, tag = "8")]
pub embedding_dims: ::prost::alloc::vec::Vec<i64>,
#[prost(message, optional, tag = "200")]
pub scheduler: ::core::option::Option<text_embedding_triplet_params::Scheduler>,
#[prost(message, optional, tag = "201")]
pub optimizer: ::core::option::Option<text_embedding_triplet_params::Optimizer>,
#[prost(oneof = "text_embedding_triplet_params::TuningType", tags = "100, 101")]
pub tuning_type: ::core::option::Option<text_embedding_triplet_params::TuningType>,
}
pub mod text_embedding_triplet_params {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Scheduler {
#[prost(oneof = "scheduler::Type", tags = "1, 2, 3")]
pub r#type: ::core::option::Option<scheduler::Type>,
#[prost(oneof = "scheduler::OptionalWarmupRatio", tags = "101")]
pub optional_warmup_ratio: ::core::option::Option<
scheduler::OptionalWarmupRatio,
>,
}
pub mod scheduler {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Type {
#[prost(message, tag = "1")]
Linear(super::super::SchedulerLinear),
#[prost(message, tag = "2")]
Constant(super::super::SchedulerConstant),
#[prost(message, tag = "3")]
Cosine(super::super::SchedulerCosine),
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum OptionalWarmupRatio {
#[prost(double, tag = "101")]
WarmupRatio(f64),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Optimizer {
#[prost(oneof = "optimizer::Type", tags = "1")]
pub r#type: ::core::option::Option<optimizer::Type>,
}
pub mod optimizer {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Type {
#[prost(message, tag = "1")]
Adamw(super::super::OptimizerAdamw),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum TuningType {
#[prost(message, tag = "100")]
Lora(super::TuningTypeLora),
#[prost(message, tag = "101")]
PromptTune(super::TuningTypePromptTune),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetMetricsUrlRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetMetricsUrlResponse {
#[prost(string, tag = "1")]
pub load_url: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOptionsRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOptionsResponse {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub base_model_uri: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub train_datasets: ::prost::alloc::vec::Vec<tuning_request::WeightedDataset>,
#[prost(message, repeated, tag = "4")]
pub validation_datasets: ::prost::alloc::vec::Vec<tuning_request::WeightedDataset>,
#[prost(
oneof = "get_options_response::TuningParams",
tags = "100, 101, 102, 103, 104"
)]
pub tuning_params: ::core::option::Option<get_options_response::TuningParams>,
}
pub mod get_options_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum TuningParams {
#[prost(message, tag = "100")]
TextToTextCompletion(super::TextToTextCompletionTuningParams),
#[prost(message, tag = "101")]
TextClassificationMultilabel(super::TextClassificationMultilabelParams),
#[prost(message, tag = "102")]
TextClassificationMulticlass(super::TextClassificationMulticlassParams),
#[prost(message, tag = "103")]
TextEmbeddingPairParams(super::TextEmbeddingPairParams),
#[prost(message, tag = "104")]
TextEmbeddingTripletParams(super::TextEmbeddingTripletParams),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListErrorsRequest {
#[prost(string, tag = "1")]
pub tuning_task_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListErrorsResponse {
#[prost(message, repeated, tag = "1")]
pub tuning_error: ::prost::alloc::vec::Vec<TuningError>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateTuningDraftRequest {
#[prost(string, tag = "1")]
pub base_model_uri: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub train_datasets: ::prost::alloc::vec::Vec<tuning_request::WeightedDataset>,
#[prost(message, repeated, tag = "3")]
pub validation_datasets: ::prost::alloc::vec::Vec<tuning_request::WeightedDataset>,
#[prost(string, tag = "200")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "201")]
pub description: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "202")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(
oneof = "create_tuning_draft_request::TuningParams",
tags = "100, 101, 102, 103, 104"
)]
pub tuning_params: ::core::option::Option<create_tuning_draft_request::TuningParams>,
}
pub mod create_tuning_draft_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum TuningParams {
#[prost(message, tag = "100")]
TextToTextCompletion(super::TextToTextCompletionTuningParams),
#[prost(message, tag = "101")]
TextClassificationMultilabel(super::TextClassificationMultilabelParams),
#[prost(message, tag = "102")]
TextClassificationMulticlass(super::TextClassificationMulticlassParams),
#[prost(message, tag = "103")]
TextEmbeddingPairParams(super::TextEmbeddingPairParams),
#[prost(message, tag = "104")]
TextEmbeddingTripletParams(super::TextEmbeddingTripletParams),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateTuningDraftResponse {
#[prost(string, tag = "1")]
pub tuning_task_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateTuningDraftRequest {
#[prost(string, tag = "1")]
pub tuning_task_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub base_model_uri: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub train_datasets: ::prost::alloc::vec::Vec<tuning_request::WeightedDataset>,
#[prost(message, repeated, tag = "4")]
pub validation_datasets: ::prost::alloc::vec::Vec<tuning_request::WeightedDataset>,
#[prost(string, tag = "200")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "201")]
pub description: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "202")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(
oneof = "update_tuning_draft_request::TuningParams",
tags = "100, 101, 102, 103, 104"
)]
pub tuning_params: ::core::option::Option<update_tuning_draft_request::TuningParams>,
}
pub mod update_tuning_draft_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum TuningParams {
#[prost(message, tag = "100")]
TextToTextCompletion(super::TextToTextCompletionTuningParams),
#[prost(message, tag = "101")]
TextClassificationMultilabel(super::TextClassificationMultilabelParams),
#[prost(message, tag = "102")]
TextClassificationMulticlass(super::TextClassificationMulticlassParams),
#[prost(message, tag = "103")]
TextEmbeddingPairParams(super::TextEmbeddingPairParams),
#[prost(message, tag = "104")]
TextEmbeddingTripletParams(super::TextEmbeddingTripletParams),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateTuningDraftResponse {
#[prost(string, tag = "1")]
pub tuning_task_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteTuningDraftRequest {
#[prost(string, tag = "1")]
pub tuning_task_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteTuningDraftResponse {
#[prost(string, tag = "1")]
pub tuning_task_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TuneDraftRequest {
#[prost(string, tag = "1")]
pub tuning_task_id: ::prost::alloc::string::String,
}
pub mod tuning_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct TuningServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl TuningServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> TuningServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> TuningServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
TuningServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn tune(
&mut self,
request: impl tonic::IntoRequest<super::TuningRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ai.tuning.v1.TuningService/Tune",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.ai.tuning.v1.TuningService", "Tune"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListTuningsRequest>,
) -> std::result::Result<
tonic::Response<super::ListTuningsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ai.tuning.v1.TuningService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.ai.tuning.v1.TuningService", "List"),
);
self.inner.unary(req, path, codec).await
}
pub async fn describe(
&mut self,
request: impl tonic::IntoRequest<super::DescribeTuningRequest>,
) -> std::result::Result<
tonic::Response<super::DescribeTuningResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ai.tuning.v1.TuningService/Describe",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.ai.tuning.v1.TuningService",
"Describe",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn cancel(
&mut self,
request: impl tonic::IntoRequest<super::CancelTuningRequest>,
) -> std::result::Result<
tonic::Response<super::CancelTuningResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ai.tuning.v1.TuningService/Cancel",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.ai.tuning.v1.TuningService", "Cancel"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_metrics_url(
&mut self,
request: impl tonic::IntoRequest<super::GetMetricsUrlRequest>,
) -> std::result::Result<
tonic::Response<super::GetMetricsUrlResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ai.tuning.v1.TuningService/GetMetricsUrl",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.ai.tuning.v1.TuningService",
"GetMetricsUrl",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_options(
&mut self,
request: impl tonic::IntoRequest<super::GetOptionsRequest>,
) -> std::result::Result<
tonic::Response<super::GetOptionsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ai.tuning.v1.TuningService/GetOptions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.ai.tuning.v1.TuningService",
"GetOptions",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_errors(
&mut self,
request: impl tonic::IntoRequest<super::ListErrorsRequest>,
) -> std::result::Result<
tonic::Response<super::ListErrorsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ai.tuning.v1.TuningService/ListErrors",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.ai.tuning.v1.TuningService",
"ListErrors",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn create_draft(
&mut self,
request: impl tonic::IntoRequest<super::CreateTuningDraftRequest>,
) -> std::result::Result<
tonic::Response<super::CreateTuningDraftResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ai.tuning.v1.TuningService/CreateDraft",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.ai.tuning.v1.TuningService",
"CreateDraft",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_draft(
&mut self,
request: impl tonic::IntoRequest<super::UpdateTuningDraftRequest>,
) -> std::result::Result<
tonic::Response<super::UpdateTuningDraftResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ai.tuning.v1.TuningService/UpdateDraft",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.ai.tuning.v1.TuningService",
"UpdateDraft",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_draft(
&mut self,
request: impl tonic::IntoRequest<super::DeleteTuningDraftRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteTuningDraftResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ai.tuning.v1.TuningService/DeleteDraft",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.ai.tuning.v1.TuningService",
"DeleteDraft",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn tune_draft(
&mut self,
request: impl tonic::IntoRequest<super::TuneDraftRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.ai.tuning.v1.TuningService/TuneDraft",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.ai.tuning.v1.TuningService",
"TuneDraft",
),
);
self.inner.unary(req, path, codec).await
}
}
}