Skip to content

Commit

Permalink
Add spec changes
Browse files Browse the repository at this point in the history
Co-authored-by: Maxime Brunet <[email protected]>
  • Loading branch information
platform-endpoints and maxbrunet committed Sep 3, 2024
1 parent ea241bf commit 97eb86f
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 32 deletions.
38 changes: 19 additions & 19 deletions cohere-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11508,7 +11508,7 @@ paths:
&MyReader{Reader: strings.NewReader(`{"text": "The quick brown fox jumps over the lazy dog"}`), name: "test.jsonl"},
&MyReader{Reader: strings.NewReader(""), name: "a.jsonl"},
&cohere.DatasetsCreateRequest{
Name: "embed-dataset",
Name: "prompt-completion-dataset",
Type: cohere.DatasetTypeEmbedResult,
},
)
Expand All @@ -11528,9 +11528,9 @@ paths:

# upload a dataset
my_dataset = co.datasets.create(
name="chat-dataset",
data=open("./chat.jsonl", "rb"),
type="chat-finetune-input",
name="prompt-completion-dataset",
data=open("./prompt-completion.jsonl", "rb"),
type="prompt-completion-finetune-input",
)

# wait for validation to complete
Expand All @@ -11550,9 +11550,9 @@ paths:

# upload a dataset
response = await co.datasets.create(
name="chat-dataset",
data=open("./chat.jsonl", "rb"),
type="chat-finetune-input",
name="prompt-completion-dataset",
data=open("./prompt-completion.jsonl", "rb"),
type="prompt-completion-finetune-input",
)

# wait for validation to complete
Expand Down Expand Up @@ -11583,7 +11583,7 @@ paths:
public static void main(String[] args) {
Cohere cohere = Cohere.builder().token("<<apiKey>>").clientName("snippet").build();

DatasetsCreateResponse response = cohere.datasets().create(null, Optional.empty(), DatasetsCreateRequest.builder().name("chat-dataset").type(DatasetType.CHAT_FINETUNE_INPUT).build());
DatasetsCreateResponse response = cohere.datasets().create(null, Optional.empty(), DatasetsCreateRequest.builder().name("prompt-completion-dataset").type(DatasetType.PROMPT_COMPLETION_FINETUNE_INPUT).build());

System.out.println(response);
}
Expand Down Expand Up @@ -14396,14 +14396,14 @@ paths:
example:
finetuned_models:
- id: fee37446-7fc7-42f9-a026-c6ba2fcc422d
name: chat-ft
name: prompt-completion-ft
creator_id: 7a317d97-4d05-427d-9396-f31b9fb92c55
organization_id: 6bdca3d5-3eae-4de0-ac34-786d8063b7ee
settings:
base_model:
name: medium
version: 14.2.0
base_type: BASE_TYPE_CHAT
base_type: BASE_TYPE_GENERATIVE
strategy: STRATEGY_TFEW
dataset_id: my-dataset-d701tr
hyperparameters:
Expand Down Expand Up @@ -14655,7 +14655,7 @@ paths:
name: api-test
settings:
base_model:
base_type: BASE_TYPE_CHAT
base_type: BASE_TYPE_GENERATIVE
dataset_id: my-dataset-id
required: true
parameters:
Expand All @@ -14677,7 +14677,7 @@ paths:
public static void main(String[] args) {
Cohere cohere = Cohere.builder().token("<<apiKey>>").clientName("snippet").build();

CreateFinetunedModelResponse response = cohere.finetuning().createFinetunedModel(FinetunedModel.builder().name("test-finetuned-model").settings(Settings.builder().baseModel(BaseModel.builder().baseType(BaseType.BASE_TYPE_CHAT).build()).datasetId("my-dataset-id").build()).build());
CreateFinetunedModelResponse response = cohere.finetuning().createFinetunedModel(FinetunedModel.builder().name("test-finetuned-model").settings(Settings.builder().baseModel(BaseModel.builder().baseType(BaseType.BASE_TYPE_GENERATIVE).build()).datasetId("my-dataset-id").build()).build());

System.out.println(response);
}
Expand Down Expand Up @@ -14707,7 +14707,7 @@ paths:
Settings: &finetuning.Settings{
DatasetId: "my-dataset-id",
BaseModel: &finetuning.BaseModel{
BaseType: finetuning.BaseTypeBaseTypeChat,
BaseType: finetuning.BaseTypeBaseTypeGenerative,
},
},
},
Expand All @@ -14734,7 +14734,7 @@ paths:
name: 'test-finetuned-model',
settings: {
base_model: {
base_type: Cohere.Finetuning.BaseType.BaseTypeChat,
base_type: Cohere.Finetuning.BaseType.BaseTypeGenerative,
},
dataset_id: 'test-dataset-id',
},
Expand Down Expand Up @@ -14823,7 +14823,7 @@ paths:
"name": "test-finetuned-model",
"settings": {
"base_model": {
"base_type": "BASE_TYPE_CHAT",
"base_type": "BASE_TYPE_GENERATIVE",
},
"dataset_id": "test-dataset-id"
}
Expand Down Expand Up @@ -14969,7 +14969,7 @@ paths:
public static void main(String[] args) {
Cohere cohere = Cohere.builder().token("<<apiKey>>").clientName("snippet").build();

UpdateFinetunedModelResponse response = cohere.finetuning().updateFinetunedModel("test-id", FinetuningUpdateFinetunedModelRequest.builder().name("new name").settings(Settings.builder().baseModel(BaseModel.builder().baseType(BaseType.BASE_TYPE_CHAT).build()).datasetId("my-dataset-id").build()).build());
UpdateFinetunedModelResponse response = cohere.finetuning().updateFinetunedModel("test-id", FinetuningUpdateFinetunedModelRequest.builder().name("new name").settings(Settings.builder().baseModel(BaseModel.builder().baseType(BaseType.BASE_TYPE_GENERATIVE).build()).datasetId("my-dataset-id").build()).build());

System.out.println(response);
}
Expand Down Expand Up @@ -15085,14 +15085,14 @@ paths:
example:
finetuned_model:
id: fee37446-7fc7-42f9-a026-c6ba2fcc422d
name: chat-ft
name: prompt-completion-ft
creator_id: 7a317d97-4d05-427d-9396-f31b9fb92c55
organization_id: 6bdca3d5-3eae-4de0-ac34-786d8063b7ee
settings:
base_model:
name: medium
version: 14.2.0
base_type: BASE_TYPE_CHAT
base_type: BASE_TYPE_GENERATIVE
strategy: STRATEGY_TFEW
dataset_id: my-dataset-d701tr
hyperparameters:
Expand Down Expand Up @@ -21188,7 +21188,7 @@ components:
readOnly: true
wandb:
$ref: "#/components/schemas/WandbConfig"
description: The Weights & Biases configuration.
description: The Weights & Biases configuration (Chat fine-tuning only).
description: The configuration used for fine-tuning.
required:
- base_model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ curl --request POST \
"name": "test-finetuned-model",
"settings": {
"base_model": {
"base_type": "BASE_TYPE_CHAT",
"base_type": "BASE_TYPE_GENERATIVE",
},
"dataset_id": "test-dataset-id"
}
Expand Down
2 changes: 1 addition & 1 deletion snippets/snippets/go/dataset-post/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func main() {
&MyReader{Reader: strings.NewReader(`{"text": "The quick brown fox jumps over the lazy dog"}`), name: "test.jsonl"},
&MyReader{Reader: strings.NewReader(""), name: "a.jsonl"},
&cohere.DatasetsCreateRequest{
Name: "embed-dataset",
Name: "prompt-completion-dataset",
Type: cohere.DatasetTypeEmbedResult,
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func main() {
Settings: &finetuning.Settings{
DatasetId: "my-dataset-id",
BaseModel: &finetuning.BaseModel{
BaseType: finetuning.BaseTypeBaseTypeChat,
BaseType: finetuning.BaseTypeBaseTypeGenerative,
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion snippets/snippets/java/app/src/main/java/DatasetPost.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class DatasetPost {
public static void main(String[] args) {
Cohere cohere = Cohere.builder().token("<<apiKey>>").clientName("snippet").build();

DatasetsCreateResponse response = cohere.datasets().create(null, Optional.empty(), DatasetsCreateRequest.builder().name("chat-dataset").type(DatasetType.CHAT_FINETUNE_INPUT).build());
DatasetsCreateResponse response = cohere.datasets().create(null, Optional.empty(), DatasetsCreateRequest.builder().name("prompt-completion-dataset").type(DatasetType.PROMPT_COMPLETION_FINETUNE_INPUT).build());

System.out.println(response);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class CreateFinetunedModel {
public static void main(String[] args) {
Cohere cohere = Cohere.builder().token("<<apiKey>>").clientName("snippet").build();

CreateFinetunedModelResponse response = cohere.finetuning().createFinetunedModel(FinetunedModel.builder().name("test-finetuned-model").settings(Settings.builder().baseModel(BaseModel.builder().baseType(BaseType.BASE_TYPE_CHAT).build()).datasetId("my-dataset-id").build()).build());
CreateFinetunedModelResponse response = cohere.finetuning().createFinetunedModel(FinetunedModel.builder().name("test-finetuned-model").settings(Settings.builder().baseModel(BaseModel.builder().baseType(BaseType.BASE_TYPE_GENERATIVE).build()).datasetId("my-dataset-id").build()).build());

System.out.println(response);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class UpdateFinetunedModel {
public static void main(String[] args) {
Cohere cohere = Cohere.builder().token("<<apiKey>>").clientName("snippet").build();

UpdateFinetunedModelResponse response = cohere.finetuning().updateFinetunedModel("test-id", FinetuningUpdateFinetunedModelRequest.builder().name("new name").settings(Settings.builder().baseModel(BaseModel.builder().baseType(BaseType.BASE_TYPE_CHAT).build()).datasetId("my-dataset-id").build()).build());
UpdateFinetunedModelResponse response = cohere.finetuning().updateFinetunedModel("test-id", FinetuningUpdateFinetunedModelRequest.builder().name("new name").settings(Settings.builder().baseModel(BaseModel.builder().baseType(BaseType.BASE_TYPE_GENERATIVE).build()).datasetId("my-dataset-id").build()).build());

System.out.println(response);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const cohere = new CohereClient({
name: 'test-finetuned-model',
settings: {
base_model: {
base_type: Cohere.Finetuning.BaseType.BaseTypeChat,
base_type: Cohere.Finetuning.BaseType.BaseTypeGenerative,
},
dataset_id: 'test-dataset-id',
},
Expand Down
6 changes: 3 additions & 3 deletions snippets/snippets/python-async/dataset-post.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ async def main():

# upload a dataset
response = await co.datasets.create(
name="chat-dataset",
data=open("./chat.jsonl", "rb"),
type="chat-finetune-input",
name="prompt-completion-dataset",
data=open("./prompt-completion.jsonl", "rb"),
type="prompt-completion-finetune-input",
)

# wait for validation to complete
Expand Down
6 changes: 3 additions & 3 deletions snippets/snippets/python/dataset-post.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

# upload a dataset
my_dataset = co.datasets.create(
name="chat-dataset",
data=open("./chat.jsonl", "rb"),
type="chat-finetune-input",
name="prompt-completion-dataset",
data=open("./prompt-completion.jsonl", "rb"),
type="prompt-completion-finetune-input",
)

# wait for validation to complete
Expand Down

0 comments on commit 97eb86f

Please sign in to comment.