@daocloud-proto/hydra 0.0.0-dev-df7fe94b → 0.0.0-dev-87f727ca
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/*
|
|
4
|
+
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as HydraCommonCommon from "../../../common/common.pb"
|
|
8
|
+
import * as fm from "../../../fetch.pb"
|
|
9
|
+
import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
10
|
+
|
|
11
|
+
export enum TrainingStage {
|
|
12
|
+
TRAINING_STAGE_UNSPECIFIED = "TRAINING_STAGE_UNSPECIFIED",
|
|
13
|
+
SFT = "SFT",
|
|
14
|
+
DPO = "DPO",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export enum FineTuningType {
|
|
18
|
+
FINE_TUNING_TYPE_UNSPECIFIED = "FINE_TUNING_TYPE_UNSPECIFIED",
|
|
19
|
+
LORA = "LORA",
|
|
20
|
+
FULL = "FULL",
|
|
21
|
+
FREEZE = "FREEZE",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type ModelConfig = {
|
|
25
|
+
modelId?: string
|
|
26
|
+
modelVolumeId?: string
|
|
27
|
+
template?: string
|
|
28
|
+
trustRemoteCode?: boolean
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type LoraConfig = {
|
|
32
|
+
loraRank?: number
|
|
33
|
+
loraAlpha?: number
|
|
34
|
+
loraDropout?: number
|
|
35
|
+
loraTarget?: string
|
|
36
|
+
additionalTarget?: string
|
|
37
|
+
loraPlusLrRatio?: number
|
|
38
|
+
loraPlusLrEmbedding?: number
|
|
39
|
+
useRslora?: boolean
|
|
40
|
+
useDora?: boolean
|
|
41
|
+
pissaInit?: boolean
|
|
42
|
+
pissaIter?: number
|
|
43
|
+
pissaConvert?: boolean
|
|
44
|
+
createNewAdapter?: boolean
|
|
45
|
+
quantizationBit?: number
|
|
46
|
+
quantizationMethod?: string
|
|
47
|
+
ropeScaling?: string
|
|
48
|
+
booster?: string
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type DatasetConfig = {
|
|
52
|
+
datasetId?: string
|
|
53
|
+
datasetVolumeId?: string
|
|
54
|
+
cutoffLen?: number
|
|
55
|
+
maxSamples?: number
|
|
56
|
+
valSize?: string
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type TrainingConfig = {
|
|
60
|
+
numTrainEpochs?: string
|
|
61
|
+
perDeviceTrainBatchSize?: number
|
|
62
|
+
gradientAccumulationSteps?: number
|
|
63
|
+
learningRate?: string
|
|
64
|
+
lrSchedulerType?: string
|
|
65
|
+
warmupRatio?: string
|
|
66
|
+
warmupSteps?: number
|
|
67
|
+
bf16?: boolean
|
|
68
|
+
optimizer?: string
|
|
69
|
+
seed?: number
|
|
70
|
+
ddpTimeout?: number
|
|
71
|
+
maxGradNorm?: string
|
|
72
|
+
neftAlpha?: number
|
|
73
|
+
deepspeedStage?: string
|
|
74
|
+
deepspeedOffload?: boolean
|
|
75
|
+
gradientCheckpointing?: boolean
|
|
76
|
+
loggingSteps?: number
|
|
77
|
+
saveSteps?: number
|
|
78
|
+
outputSubPath?: string
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type DpoConfig = {
|
|
82
|
+
prefBeta?: string
|
|
83
|
+
prefLoss?: string
|
|
84
|
+
prefFtx?: string
|
|
85
|
+
dpoLabelSmoothing?: string
|
|
86
|
+
refModel?: string
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type ResourceQuota = {
|
|
90
|
+
request?: string
|
|
91
|
+
limit?: string
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export type ResourceConfig = {
|
|
95
|
+
replicas?: number
|
|
96
|
+
gpuType?: string
|
|
97
|
+
gpuCount?: number
|
|
98
|
+
cpu?: ResourceQuota
|
|
99
|
+
memory?: ResourceQuota
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export type FineTuneConfig = {
|
|
103
|
+
name?: string
|
|
104
|
+
cluster?: string
|
|
105
|
+
stage?: TrainingStage
|
|
106
|
+
finetuningType?: FineTuningType
|
|
107
|
+
model?: ModelConfig
|
|
108
|
+
lora?: LoraConfig
|
|
109
|
+
dataset?: DatasetConfig
|
|
110
|
+
training?: TrainingConfig
|
|
111
|
+
dpo?: DpoConfig
|
|
112
|
+
resources?: ResourceConfig
|
|
113
|
+
createdAt?: GoogleProtobufTimestamp.Timestamp
|
|
114
|
+
updatedAt?: GoogleProtobufTimestamp.Timestamp
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export type CreateWSFineTuneConfigRequest = {
|
|
118
|
+
workspace?: number
|
|
119
|
+
cluster?: string
|
|
120
|
+
name?: string
|
|
121
|
+
stage?: TrainingStage
|
|
122
|
+
finetuningType?: FineTuningType
|
|
123
|
+
model?: ModelConfig
|
|
124
|
+
lora?: LoraConfig
|
|
125
|
+
dataset?: DatasetConfig
|
|
126
|
+
training?: TrainingConfig
|
|
127
|
+
dpo?: DpoConfig
|
|
128
|
+
resources?: ResourceConfig
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export type UpdateWSFineTuneConfigRequest = {
|
|
132
|
+
workspace?: number
|
|
133
|
+
cluster?: string
|
|
134
|
+
name?: string
|
|
135
|
+
stage?: TrainingStage
|
|
136
|
+
finetuningType?: FineTuningType
|
|
137
|
+
model?: ModelConfig
|
|
138
|
+
lora?: LoraConfig
|
|
139
|
+
dataset?: DatasetConfig
|
|
140
|
+
training?: TrainingConfig
|
|
141
|
+
dpo?: DpoConfig
|
|
142
|
+
resources?: ResourceConfig
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export type GetWSFineTuneConfigRequest = {
|
|
146
|
+
workspace?: number
|
|
147
|
+
name?: string
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export type ListWSFineTuneConfigsRequest = {
|
|
151
|
+
workspace?: number
|
|
152
|
+
cluster?: string
|
|
153
|
+
page?: HydraCommonCommon.Pagination
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export type ListWSFineTuneConfigsResponse = {
|
|
157
|
+
items?: FineTuneConfig[]
|
|
158
|
+
page?: HydraCommonCommon.Pagination
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export type DeleteWSFineTuneConfigRequest = {
|
|
162
|
+
workspace?: number
|
|
163
|
+
name?: string
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export class WSFineTuneConfigManagement {
|
|
167
|
+
static CreateWSFineTuneConfig(req: CreateWSFineTuneConfigRequest, initReq?: fm.InitReq): Promise<FineTuneConfig> {
|
|
168
|
+
return fm.fetchReq<CreateWSFineTuneConfigRequest, FineTuneConfig>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/train-configs`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
169
|
+
}
|
|
170
|
+
static UpdateWSFineTuneConfig(req: UpdateWSFineTuneConfigRequest, initReq?: fm.InitReq): Promise<FineTuneConfig> {
|
|
171
|
+
return fm.fetchReq<UpdateWSFineTuneConfigRequest, FineTuneConfig>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/train-configs/${req["name"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
172
|
+
}
|
|
173
|
+
static GetWSFineTuneConfig(req: GetWSFineTuneConfigRequest, initReq?: fm.InitReq): Promise<FineTuneConfig> {
|
|
174
|
+
return fm.fetchReq<GetWSFineTuneConfigRequest, FineTuneConfig>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/train-configs/${req["name"]}?${fm.renderURLSearchParams(req, ["workspace", "name"])}`, {...initReq, method: "GET"})
|
|
175
|
+
}
|
|
176
|
+
static ListWSFineTuneConfigs(req: ListWSFineTuneConfigsRequest, initReq?: fm.InitReq): Promise<ListWSFineTuneConfigsResponse> {
|
|
177
|
+
return fm.fetchReq<ListWSFineTuneConfigsRequest, ListWSFineTuneConfigsResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/train-configs?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
178
|
+
}
|
|
179
|
+
static DeleteWSFineTuneConfig(req: DeleteWSFineTuneConfigRequest, initReq?: fm.InitReq): Promise<FineTuneConfig> {
|
|
180
|
+
return fm.fetchReq<DeleteWSFineTuneConfigRequest, FineTuneConfig>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/train-configs/${req["name"]}`, {...initReq, method: "DELETE"})
|
|
181
|
+
}
|
|
182
|
+
}
|