@@ -41,139 +41,6 @@ object FineTuningRequestBody {
41
41
implicit val fineTuningRequestBodyWriter : SnakePickle .Writer [FineTuningRequestBody ] = SnakePickle .macroW[FineTuningRequestBody ]
42
42
}
43
43
44
- sealed abstract class Type (val value : String )
45
-
46
- object Type {
47
- implicit def typeRW (implicit byTypeValue : Map [String , Type ]): SnakePickle .ReadWriter [Type ] = SnakePickle
48
- .readwriter[ujson.Value ]
49
- .bimap[Type ](
50
- `type` => SnakePickle .writeJs(`type`.value),
51
- jsonValue =>
52
- SnakePickle .read[ujson.Value ](jsonValue) match {
53
- case Str (value) =>
54
- byTypeValue.get(value) match {
55
- case Some (t) => t
56
- case None => throw DeserializationOpenAIException (new Exception (s " Could not deserialize: $value" ))
57
- }
58
- case e => throw DeserializationOpenAIException (new Exception (s " Could not deserialize: $e" ))
59
- }
60
- )
61
- }
62
-
63
- /** @param batchSize
64
- * Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower
65
- * variance.
66
- * @param learningRateMultiplier
67
- * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
68
- * @param nEpochs
69
- * The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
70
- * @param beta
71
- * The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.
72
- */
73
- case class Hyperparameters (
74
- batchSize : Option [Int ] = None ,
75
- learningRateMultiplier : Option [Float ] = None ,
76
- nEpochs : Option [Int ] = None ,
77
- beta : Option [Float ] = None
78
- )
79
-
80
- object Hyperparameters {
81
- implicit val hyperparametersW : SnakePickle .Writer [Hyperparameters ] = SnakePickle .macroW[Hyperparameters ]
82
- }
83
-
84
- /** @param hyperparameters
85
- * The hyperparameters used for the fine-tuning job.
86
- */
87
- case class Supervised (
88
- hyperparameters : Option [Hyperparameters ] = None
89
- )
90
-
91
- object Supervised {
92
- implicit val supervisedW : SnakePickle .Writer [Supervised ] = SnakePickle .macroW[Supervised ]
93
- }
94
-
95
- /** @param hyperparameters
96
- * The hyperparameters used for the fine-tuning job.
97
- */
98
- case class Dpo (
99
- hyperparameters : Option [Hyperparameters ] = None
100
- )
101
-
102
- object Dpo {
103
- implicit val dpoW : SnakePickle .Writer [Dpo ] = SnakePickle .macroW[Dpo ]
104
- }
105
-
106
- /** @param `type`
107
- * The type of method. Is either supervised or dpo.
108
- * @param supervised
109
- * Configuration for the supervised fine-tuning method.
110
- * @param dpo
111
- * Configuration for the DPO fine-tuning method.
112
- */
113
- case class Method (
114
- `type` : Option [Type ] = None ,
115
- supervised : Option [Supervised ] = None ,
116
- dpo : Option [Dpo ] = None
117
- )
118
-
119
- object Method {
120
- implicit val methodW : SnakePickle .Writer [Method ] = SnakePickle .macroW[Method ]
121
-
122
- case object Supervised extends Type (" supervised" )
123
-
124
- case object Dpo extends Type (" dpo" )
125
-
126
- private val values : Set [Type ] = Set (Supervised , Dpo )
127
-
128
- implicit val byTypeValue : Map [String , Type ] = values.map(`type` => `type`.value -> `type`).toMap
129
- }
130
-
131
- /** @param project
132
- * The name of the project that the new run will be created under.
133
- * @param name
134
- * A display name to set for the run. If not set, we will use the Job ID as the name.
135
- * @param entity
136
- * The entity to use for the run. This allows you to set the team or username of the WandB user that you would like associated with the
137
- * run. If not set, the default entity for the registered WandB API key is used.
138
- * @param tags
139
- * A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some default tags are
140
- * generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}".
141
- */
142
- case class Wandb (
143
- project : String ,
144
- name : Option [String ] = None ,
145
- entity : Option [String ] = None ,
146
- tags : Option [Seq [String ]]
147
- )
148
-
149
- object Wandb {
150
- implicit val wandbW : SnakePickle .Writer [Wandb ] = SnakePickle .macroW[Wandb ]
151
- }
152
-
153
- /** @param `type`
154
- * The type of integration to enable. Currently, only "wandb" (Weights and Biases) is supported.
155
- * @param wandb
156
- * The settings for your integration with Weights and Biases. This payload specifies the project that metrics will be sent to.
157
- * Optionally, you can set an explicit display name for your run, add tags to your run, and set a default entity (team, username, etc) to
158
- * be associated with your run.
159
- */
160
- case class Integration (
161
- `type` : Type ,
162
- wandb : Wandb
163
- )
164
-
165
- object Integration {
166
- implicit val integrationW : SnakePickle .Writer [Integration ] = SnakePickle .macroW[Integration ]
167
-
168
- case object Wandb extends Type (" wandb" )
169
-
170
- private val values : Set [Type ] = Set (Wandb )
171
-
172
- private val byTypeValue = values.map(`type` => `type`.value -> `type`).toMap
173
-
174
- implicit val typeRW : SnakePickle .ReadWriter [Type ] = Type .typeRW(byTypeValue)
175
- }
176
-
177
44
sealed abstract class FineTuningModel (val value : String )
178
45
179
46
object FineTuningModel {
0 commit comments