Skip to content

Commit

Permalink
feat: Updated OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 5, 2024
1 parent e2bb0c1 commit 6374117
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/Cohere/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6219,7 +6219,7 @@ paths:
code: "from cohere.finetuning import (\n BaseModel,\n FinetunedModel,\n Hyperparameters,\n Settings,\n WandbConfig\n)\nimport cohere\n\nco = cohere.Client(\"<<apiKey>>\")\nhp = Hyperparameters(\n early_stopping_patience=10,\n early_stopping_threshold=0.001,\n train_batch_size=16,\n train_epoch=1,\n learning_rate=0.01,\n)\nwnb_config = WandbConfig(\n project=\"test-project\",\n api_key=\"<<wandbApiKey>>\",\n entity=\"test-entity\",\n)\nfinetuned_model = co.finetuning.create_finetuned_model(\n request=FinetunedModel(\n name=\"test-finetuned-model\",\n settings=Settings(\n base_model=BaseModel(\n base_type=\"BASE_TYPE_CHAT\",\n ),\n dataset_id=\"my-dataset-id\",\n hyperparameters=hp,\n wandb=wnb_config,\n ),\n )\n)\nprint(finetuned_model)\n"
- sdk: python
name: Async
code: "from cohere.finetuning import (\n BaseModel,\n BaseType,\n FinetunedModel,\n Settings,\n)\nimport cohere\nimport asyncio\n\nco = cohere.AsyncClient(\"<<apiKey>>\")\n\n\nasync def main():\n response = await co.finetuning.create_finetuned_model(\n request=FinetunedModel(\n name=\"test-finetuned-model\",\n settings=Settings(\n base_model=BaseModel(\n base_type=BaseType.BASE_TYPE_CHAT,\n ),\n dataset_id=\"my-dataset-id\",\n ),\n )\n )\n print(response)\n\nasyncio.run(main())\n"
code: "from cohere.finetuning import (\n BaseModel,\n FinetunedModel,\n Settings,\n)\nimport cohere\nimport asyncio\n\nco = cohere.AsyncClient(\"<<apiKey>>\")\n\n\nasync def main():\n response = await co.finetuning.create_finetuned_model(\n request=FinetunedModel(\n name=\"test-finetuned-model\",\n settings=Settings(\n base_model=BaseModel(\n base_type=\"BASE_TYPE_CHAT\",\n ),\n dataset_id=\"my-dataset-id\",\n ),\n )\n )\n print(response)\n\nasyncio.run(main())\n"
- sdk: curl
name: cURL
code: "curl --request POST \\\n --url https://api.cohere.com/v1/finetuning/finetuned-models \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --header \"Authorization: bearer $CO_API_KEY\" \\\n --data '{\n \"name\": \"test-finetuned-model\",\n \"settings\": {\n \"base_model\": {\n \"base_type\": \"BASE_TYPE_CHAT\",\n },\n \"dataset_id\": \"test-dataset-id\"\n }\n }'\n"
Expand Down

0 comments on commit 6374117

Please sign in to comment.