mirror of
https://github.com/james-m-jordan/openai-cookbook.git
synced 2025-05-09 19:32:38 +00:00
Merge pull request #6 from openai/ted/update-examples
Ted/update examples
This commit is contained in:
commit
1ca1c2946b
@ -141,7 +141,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"embeddings = openai.Embedding.create(engine=deployment_id,\n",
|
"embeddings = openai.Embedding.create(deployment_id=deployment_id,\n",
|
||||||
" input=\"The food was delicious and the waiter...\")\n",
|
" input=\"The food was delicious and the waiter...\")\n",
|
||||||
" \n",
|
" \n",
|
||||||
"print(embeddings)"
|
"print(embeddings)"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"# Azure Fune tuning example\n",
|
"# Azure Fine tuning example\n",
|
||||||
"In this example we'll try to go over all operations that can be done using the Azure endpoints and their differences with the openAi endpoints (if any).<br>\n",
|
"In this example we'll try to go over all operations that can be done using the Azure endpoints and their differences with the openAi endpoints (if any).<br>\n",
|
||||||
"This example focuses on finetuning but touches on the majority of operations that are also available using the API. This example is meant to be a quick way of showing simple operations and is not meant as a finetune model adaptation tutorial.\n"
|
"This example focuses on finetuning but touches on the majority of operations that are also available using the API. This example is meant to be a quick way of showing simple operations and is not meant as a finetune model adaptation tutorial.\n"
|
||||||
]
|
]
|
||||||
@ -414,7 +414,7 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"print('Sending a test completion job')\n",
|
"print('Sending a test completion job')\n",
|
||||||
"start_phrase = 'When I go to the store, I want a'\n",
|
"start_phrase = 'When I go to the store, I want a'\n",
|
||||||
"response = openai.Completion.create(engine=deployment_id, prompt=start_phrase, max_tokens=4)\n",
|
"response = openai.Completion.create(deployment_id=deployment_id, prompt=start_phrase, max_tokens=4)\n",
|
||||||
"text = response['choices'][0]['text'].replace('\\n', '').replace(' .', '.').strip()\n",
|
"text = response['choices'][0]['text'].replace('\\n', '').replace(' .', '.').strip()\n",
|
||||||
"print(f'\"{start_phrase} {text}\"')\n"
|
"print(f'\"{start_phrase} {text}\"')\n"
|
||||||
]
|
]
|
||||||
|
@ -298,8 +298,10 @@
|
|||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"## 2.5 Search file\n",
|
"## 2.5 Search file (DEPRECATED)\n",
|
||||||
"We create a search file ([API reference](https://beta.openai.com/docs/api-reference/files/list)), which can be used to retrieve the relevant context when a question is asked.\n"
|
"We create a search file ([API reference](https://beta.openai.com/docs/api-reference/files/list)), which can be used to retrieve the relevant context when a question is asked.\n",
|
||||||
|
"\n",
|
||||||
|
"<span style=\"color:orange\">**DEPRECATED: The /search endpoint is deprecated in favour of using embeddings. Embeddings are cheaper, faster and can support a better search experience. See [Question Answering Guide](https://github.com/openai/openai-cookbook/blob/main/examples/Question_answering_using_embeddings.ipynb) for a search implementation using the embeddings**</span>\n"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -725,11 +727,9 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"interpreter": {
|
|
||||||
"hash": "be4b5d5b73a21c599de40d6deb1129796d12dc1cc33a738f7bac13269cfcafe8"
|
|
||||||
},
|
|
||||||
"kernelspec": {
|
"kernelspec": {
|
||||||
"display_name": "Python 3.7.3 64-bit ('base': conda)",
|
"display_name": "Python 3.9.9 64-bit ('3.9.9')",
|
||||||
|
"language": "python",
|
||||||
"name": "python3"
|
"name": "python3"
|
||||||
},
|
},
|
||||||
"language_info": {
|
"language_info": {
|
||||||
@ -742,9 +742,14 @@
|
|||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.7.3"
|
"version": "3.9.9"
|
||||||
},
|
},
|
||||||
"orig_nbformat": 4
|
"orig_nbformat": 4,
|
||||||
|
"vscode": {
|
||||||
|
"interpreter": {
|
||||||
|
"hash": "cb9817b186a29e4e9713184d901f26c1ee05ad25243d878baff7f31bb1fef480"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
"nbformat_minor": 2
|
"nbformat_minor": 2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user