Update ChatOpenAI docs with fine-tuning example (#9632)

This commit is contained in:
Jacob Lee 2023-08-22 16:56:53 -07:00 committed by GitHub
parent fc64e6349e
commit 632a83c48e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,12 +143,39 @@
] ]
}, },
{ {
"cell_type": "code", "cell_type": "markdown",
"execution_count": null, "id": "57e27714",
"id": "c095285d",
"metadata": {}, "metadata": {},
"outputs": [], "source": [
"source": [] "## Fine-tuning\n",
"\n",
"You can call fine-tuned OpenAI models by passing in your corresponding `modelName` parameter.\n",
"\n",
"This generally takes the form of `ft:{OPENAI_MODEL_NAME}:{ORG_NAME}::{MODEL_ID}`. For example:"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "33c4a8b0",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"AIMessage(content=\"J'adore la programmation.\", additional_kwargs={}, example=False)"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"fine_tuned_model = ChatOpenAI(temperature=0, model_name=\"ft:gpt-3.5-turbo-0613:langchain::7qTVM5AR\")\n",
"\n",
"fine_tuned_model(messages)"
]
} }
], ],
"metadata": { "metadata": {
@ -167,7 +194,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.9.7" "version": "3.10.5"
} }
}, },
"nbformat": 4, "nbformat": 4,