From c5dbb64bf2cfd0d4072a5e98064f6521333cc39f Mon Sep 17 00:00:00 2001 From: Denis Rothman <30811222+Denis2054@users.noreply.github.com> Date: Thu, 4 Jan 2024 04:35:52 +0100 Subject: [PATCH] API update --- Chapter07/Getting_Started_GPT_3.ipynb | 66 +++++++++++++-------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/Chapter07/Getting_Started_GPT_3.ipynb b/Chapter07/Getting_Started_GPT_3.ipynb index e51d14f..c37e36e 100644 --- a/Chapter07/Getting_Started_GPT_3.ipynb +++ b/Chapter07/Getting_Started_GPT_3.ipynb @@ -14,14 +14,14 @@ }, { "cell_type": "markdown", + "metadata": { + "id": "h3I25Z2L0bP8" + }, "source": [ - "# December 6,2023 OpenAI API update\n", + "# January,2024 OpenAI API update\n", "\n", "[This notebook has been updated. See README \"Getting Started with OpenAI API\" section before running this notebook](https://github.com/Denis2054/Transformers-for-NLP-2nd-Edition/blob/main/README.md#getting-started-with-openai-api)" - ], - "metadata": { - "id": "h3I25Z2L0bP8" - } + ] }, { "cell_type": "code", @@ -38,16 +38,16 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "5U6ZZRk20Ts9", - "outputId": "81ef01a9-0140-439e-a556-c410be744a68", "colab": { "base_uri": "https://localhost:8080/" - } + }, + "id": "5U6ZZRk20Ts9", + "outputId": "81ef01a9-0140-439e-a556-c410be744a68" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Collecting tiktoken\n", " Downloading tiktoken-0.5.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB)\n", @@ -115,16 +115,16 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "qS_Qk62FxclT", - "outputId": "3b5d196e-b28b-4a96-df84-134850e44dc9", "colab": { "base_uri": "https://localhost:8080/" - } + }, + "id": "qS_Qk62FxclT", + "outputId": "3b5d196e-b28b-4a96-df84-134850e44dc9" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Collecting openai\n", " Downloading openai-1.3.7-py3-none-any.whl (221 kB)\n", @@ -156,7 +156,7 @@ "try:\n", " import openai\n", "except:\n", - " !pip install openai\n", + " !pip install openai==0.28 -qq\n", " import openai" ] }, @@ -173,16 +173,16 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "P6uKDkb3y7QZ", - "outputId": "489f6467-a7df-4ad0-e075-fc9b15408cee", "colab": { "base_uri": "https://localhost:8080/" - } + }, + "id": "P6uKDkb3y7QZ", + "outputId": "489f6467-a7df-4ad0-e075-fc9b15408cee" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Mounted at /content/drive\n" ] @@ -271,8 +271,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Completion(id='cmpl-8SfqQfqWPYiRvNGY1vo8F0LB2y8qP', choices=[CompletionChoice(finish_reason='stop', index=0, logprobs=None, text=\" She didn't go to the market.\")], created=1701844726, model='davinci-002', object='text_completion', system_fingerprint=None, usage=CompletionUsage(completion_tokens=8, prompt_tokens=13, total_tokens=21))\n" ] @@ -295,8 +295,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ " She didn't go to the market.\n" ] @@ -330,8 +330,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ " Elle n'est pas allΓ©e au marchΓ©.\n" ] @@ -373,8 +373,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ " Click on the tools menu, then click on the Internet options.\n", "Click on the advanced tab, then click to clear or select the enable\n", @@ -431,8 +431,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ " πŸ•·πŸ•ΈπŸ•·πŸ•ΈπŸ•·πŸ•ΈπŸ•·πŸ•Έ\n" ] @@ -464,8 +464,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ " πŸŒπŸŒŽπŸŒβœˆοΈπŸ”πŸŒ³πŸœπŸ•πŸŒΊπŸŒž\n" ] @@ -516,8 +516,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "ChatCompletion(id='chatcmpl-8SfqS7C9gcXjLqvhAoqC3bpdzgq92', choices=[Choice(finish_reason='stop', index=0, message=ChatCompletionMessage(content=\"SELECT AVG(total_order_value) AS average_total_order_value\\nFROM (\\n SELECT o.OrderID, SUM(od.Quantity * p.UnitPrice) AS total_order_value\\n FROM Orders o\\n INNER JOIN OrderDetails od ON o.OrderID = od.OrderID\\n INNER JOIN Products p ON od.ProductID = p.ProductID\\n WHERE o.OrderDate = '2023-04-01'\\n GROUP BY o.OrderID\\n) AS subquery;\", role='assistant', function_call=None, tool_calls=None))], created=1701844728, model='gpt-3.5-turbo-0613', object='chat.completion', system_fingerprint=None, usage=CompletionUsage(completion_tokens=93, prompt_tokens=205, total_tokens=298))\n" ] @@ -576,8 +576,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ " Negative\n", "2. Negative\n", @@ -616,8 +616,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "0.5\n" ] @@ -660,8 +660,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "1. What is the difference between a sign and a symbol?\n" ] @@ -704,8 +704,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Jupiter is the fifth planet from the Sun and the largest in the Solar System. It is a gas giant with a mass one-thousandth that of the Sun, but two-and-a-half times that of all the other planets in the Solar System combined. Jupiter is one of the brightest objects visible to the naked eye in the night sky, and has been known to ancient civilizations since before recorded history. It is named after the Roman god Jupiter.\n", "\n" @@ -749,8 +749,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "| Pounits | Bright green | Savory |\n", "| Loopnovas | Neon pink | Cotton candy |\n", @@ -795,8 +795,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ " O(n^2*k)\n" ] @@ -828,8 +828,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ " \n", "\n", @@ -877,4 +877,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +}