-
Notifications
You must be signed in to change notification settings - Fork 5.1k
/
finetune.tsp
108 lines (100 loc) · 4.47 KB
/
finetune.tsp
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
97
98
99
100
101
102
103
104
105
106
107
108
import "@azure-tools/typespec-azure-core";
import "@typespec/rest";
import "@typespec/http";
import "./models/finetune.models.tsp";
import "./serviceCustomizations.tsp";
namespace Azure.OpenAI;
using TypeSpec.Rest;
using TypeSpec.Http;
using Azure.Core;
interface FineTunes {
#suppress "@azure-tools/cadl-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation."
@summary("""
Gets a list of all fine-tune jobs owned by the Azure OpenAI resource.
The details that are returned for each fine-tune job contain besides its
identifier the base model, training and validation files, hyper parameters,
time stamps, status and events. Events are created when the job status
changes, e.g. running or complete, and when results are uploaded.
""")
@doc("""
Gets a list of all fine-tune jobs owned by the Azure OpenAI resource.
The details that are returned for each fine-tune job contain besides its
identifier the base model, training and validation files, hyper parameters,
time stamps, status and events. Events are created when the job status
changes, e.g. running or complete, and when results are uploaded.
""")
@route("/fine-tunes")
@get
// TODO: enum value types not supported in csharp emitter, change string literal to TypeDiscriminatorKnownValues enum when fixed
ListFineTunes is ServiceCustomizations.OpenAIListOperation<FineTune, "fine-tune">;
#suppress "@azure-tools/cadl-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation."
@summary("""
Creates a job that fine-tunes a specified model from a given training
file.
Response includes details of the enqueued job including job status and
hyper parameters.
The name of the fine-tuned model is added to the response
once complete.
""")
@doc("""
Creates a job that fine-tunes a specified model from a given training
file.
Response includes details of the enqueued job including job status and
hyper parameters.
The name of the fine-tuned model is added to the response
once complete.
""")
@route("/fine-tunes")
@post
CreateFineTune is Foundations.Operation<
FineTuneCreation,
FineTune & CreatedResponse
>;
@summary("""
Gets details for a single fine-tune job specified by the given
fine_tune_id.
The details contain the base model, training and validation
files, hyper parameters, time stamps, status and events.
Events are created
when the job status changes, e.g. running or complete, and when results are
uploaded.
""")
@doc("""
Gets details for a single fine-tune job specified by the given
fine_tune_id.
The details contain the base model, training and validation
files, hyper parameters, time stamps, status and events.
Events are created
when the job status changes, e.g. running or complete, and when results are
uploaded.
""")
GetFineTune is ResourceRead<FineTune>;
@summary("Deletes the fine-tune job specified by the given fine_tune_id.")
@doc("Deletes the fine-tune job specified by the given fine_tune_id.")
DeleteFineTune is ResourceDelete<FineTune>;
#suppress "@azure-tools/cadl-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation."
@summary("""
List events for the fine-tune job specified by the given fine_tune_id.
Events are created when the job status changes, e.g. running or
complete, and when results are uploaded.
""")
@doc("""
List events for the fine-tune job specified by the given fine_tune_id.
Events are created when the job status changes, e.g. running or
complete, and when results are uploaded.
""")
@Cadl.Rest.actionSeparator("/")
@get
ListFineTuneEvents is Azure.Core.ResourceAction<FineTune,
{
@doc("A flag indicating whether to stream events for the fine-tune job. If set to true,\nevents will be sent as data-only server-sent events as they become available. The stream will terminate with\na data: [DONE] message when the job is finished (succeeded, cancelled, or failed).\nIf set to false, only events generated so far will be returned..")
@query stream: boolean
}, ServiceCustomizations.OpenAiList<Event, TypeDiscriminator>>;
// #suppress "@azure-tools/cadl-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation."
@summary("Cancels the processing of the fine-tune job specified by the given fine_tune_id.")
@doc("Cancels the processing of the fine-tune job specified by the given fine_tune_id.")
@post
@action("cancel")
@actionSeparator("/")
CancelFineTune is ResourceAction<FineTune, {}, FineTune>;
}