-
Notifications
You must be signed in to change notification settings - Fork 2.8k
/
job_create_params.py
78 lines (54 loc) · 2.55 KB
/
job_create_params.py
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
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing import Union, Optional
from typing_extensions import Literal, Required, TypedDict
__all__ = ["JobCreateParams", "Hyperparameters"]
class JobCreateParams(TypedDict, total=False):
model: Required[Union[str, Literal["babbage-002", "davinci-002", "gpt-3.5-turbo"]]]
"""The name of the model to fine-tune.
You can select one of the
[supported models](https://platform.openai.com/docs/guides/fine-tuning/what-models-can-be-fine-tuned).
"""
training_file: Required[str]
"""The ID of an uploaded file that contains training data.
See [upload file](https://platform.openai.com/docs/api-reference/files/upload)
for how to upload a file.
Your dataset must be formatted as a JSONL file. Additionally, you must upload
your file with the purpose `fine-tune`.
See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning)
for more details.
"""
hyperparameters: Hyperparameters
"""The hyperparameters used for the fine-tuning job."""
suffix: Optional[str]
"""
A string of up to 18 characters that will be added to your fine-tuned model
name.
For example, a `suffix` of "custom-model-name" would produce a model name like
`ft:gpt-3.5-turbo:openai:custom-model-name:7p4lURel`.
"""
validation_file: Optional[str]
"""The ID of an uploaded file that contains validation data.
If you provide this file, the data is used to generate validation metrics
periodically during fine-tuning. These metrics can be viewed in the fine-tuning
results file. The same data should not be present in both train and validation
files.
Your dataset must be formatted as a JSONL file. You must upload your file with
the purpose `fine-tune`.
See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning)
for more details.
"""
class Hyperparameters(TypedDict, total=False):
batch_size: Union[Literal["auto"], int]
"""Number of examples in each batch.
A larger batch size means that model parameters are updated less frequently, but
with lower variance.
"""
learning_rate_multiplier: Union[Literal["auto"], float]
"""Scaling factor for the learning rate.
A smaller learning rate may be useful to avoid overfitting.
"""
n_epochs: Union[Literal["auto"], int]
"""The number of epochs to train the model for.
An epoch refers to one full cycle through the training dataset.
"""