Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use any for n_epochs #499

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fine_tuning_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type FineTuningJob struct {
}

type Hyperparameters struct {
Epochs int `json:"n_epochs"`
Epochs any `json:"n_epochs,omitempty"`
}

type FineTuningJobRequest struct {
Expand Down
19 changes: 17 additions & 2 deletions fine_tuning_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,23 @@ func TestFineTuningJob(t *testing.T) {
server.RegisterHandler(
"/v1/fine_tuning/jobs",
func(w http.ResponseWriter, r *http.Request) {
var resBytes []byte
resBytes, _ = json.Marshal(FineTuningJob{})
resBytes, _ := json.Marshal(FineTuningJob{
Object: "fine_tuning.job",
ID: testFineTuninigJobID,
Model: "davinci-002",
CreatedAt: 1692661014,
FinishedAt: 1692661190,
FineTunedModel: "ft:davinci-002:my-org:custom_suffix:7q8mpxmy",
OrganizationID: "org-123",
ResultFiles: []string{"file-abc123"},
Status: "succeeded",
ValidationFile: "",
TrainingFile: "file-abc123",
Hyperparameters: Hyperparameters{
Epochs: "auto",
},
TrainedTokens: 5768,
})
fmt.Fprintln(w, string(resBytes))
},
)
Expand Down
Loading