-
Notifications
You must be signed in to change notification settings - Fork 6
/
finetuning.go
96 lines (88 loc) · 3.65 KB
/
finetuning.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// This file was auto-generated by Fern from our API Definition.
package api
import (
json "encoding/json"
core "github.com/cohere-ai/cohere-go/v2/core"
finetuning "github.com/cohere-ai/cohere-go/v2/finetuning"
time "time"
)
type FinetuningListEventsRequest struct {
// Maximum number of results to be returned by the server. If 0, defaults to 50.
PageSize *int `json:"-" url:"page_size,omitempty"`
// Request a specific page of the list results.
PageToken *string `json:"-" url:"page_token,omitempty"`
// Comma separated list of fields. For example: "created_at,name". The default
// sorting order is ascending. To specify descending order for a field, append
// " desc" to the field name. For example: "created_at desc,name".
//
// Supported sorting fields:
//
// - created_at (default)
OrderBy *string `json:"-" url:"order_by,omitempty"`
}
type FinetuningListFinetunedModelsRequest struct {
// Maximum number of results to be returned by the server. If 0, defaults to 50.
PageSize *int `json:"-" url:"page_size,omitempty"`
// Request a specific page of the list results.
PageToken *string `json:"-" url:"page_token,omitempty"`
// Comma separated list of fields. For example: "created_at,name". The default
// sorting order is ascending. To specify descending order for a field, append
// " desc" to the field name. For example: "created_at desc,name".
//
// Supported sorting fields:
//
// - created_at (default)
OrderBy *string `json:"-" url:"order_by,omitempty"`
}
type FinetuningListTrainingStepMetricsRequest struct {
// Maximum number of results to be returned by the server. If 0, defaults to 50.
PageSize *int `json:"-" url:"page_size,omitempty"`
// Request a specific page of the list results.
PageToken *string `json:"-" url:"page_token,omitempty"`
}
type FinetuningUpdateFinetunedModelRequest struct {
// FinetunedModel name (e.g. `foobar`).
Name string `json:"name" url:"-"`
// User ID of the creator.
CreatorId *string `json:"creator_id,omitempty" url:"-"`
// Organization ID.
OrganizationId *string `json:"organization_id,omitempty" url:"-"`
// FinetunedModel settings such as dataset, hyperparameters...
Settings *finetuning.Settings `json:"settings,omitempty" url:"-"`
// Current stage in the life-cycle of the fine-tuned model.
Status *finetuning.Status `json:"status,omitempty" url:"-"`
// Creation timestamp.
CreatedAt *time.Time `json:"created_at,omitempty" url:"-"`
// Latest update timestamp.
UpdatedAt *time.Time `json:"updated_at,omitempty" url:"-"`
// Timestamp for the completed fine-tuning.
CompletedAt *time.Time `json:"completed_at,omitempty" url:"-"`
// Timestamp for the latest request to this fine-tuned model.
LastUsed *time.Time `json:"last_used,omitempty" url:"-"`
}
func (f *FinetuningUpdateFinetunedModelRequest) UnmarshalJSON(data []byte) error {
type unmarshaler FinetuningUpdateFinetunedModelRequest
var body unmarshaler
if err := json.Unmarshal(data, &body); err != nil {
return err
}
*f = FinetuningUpdateFinetunedModelRequest(body)
return nil
}
func (f *FinetuningUpdateFinetunedModelRequest) MarshalJSON() ([]byte, error) {
type embed FinetuningUpdateFinetunedModelRequest
var marshaler = struct {
embed
CreatedAt *core.DateTime `json:"created_at,omitempty"`
UpdatedAt *core.DateTime `json:"updated_at,omitempty"`
CompletedAt *core.DateTime `json:"completed_at,omitempty"`
LastUsed *core.DateTime `json:"last_used,omitempty"`
}{
embed: embed(*f),
CreatedAt: core.NewOptionalDateTime(f.CreatedAt),
UpdatedAt: core.NewOptionalDateTime(f.UpdatedAt),
CompletedAt: core.NewOptionalDateTime(f.CompletedAt),
LastUsed: core.NewOptionalDateTime(f.LastUsed),
}
return json.Marshal(marshaler)
}