Skip to content

Commit

Permalink
API update
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis2054 authored Jan 4, 2024
1 parent ea84378 commit c5dbb64
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions Chapter07/Getting_Started_GPT_3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -156,7 +156,7 @@
"try:\n",
" import openai\n",
"except:\n",
" !pip install openai\n",
" !pip install openai==0.28 -qq\n",
" import openai"
]
},
Expand All @@ -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"
]
Expand Down Expand Up @@ -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"
]
Expand All @@ -295,8 +295,8 @@
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
" She didn't go to the market.\n"
]
Expand Down Expand Up @@ -330,8 +330,8 @@
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
" Elle n'est pas allée au marché.\n"
]
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -431,8 +431,8 @@
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
" 🕷🕸🕷🕸🕷🕸🕷🕸\n"
]
Expand Down Expand Up @@ -464,8 +464,8 @@
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
" 🌏🌎🌍✈️🏔🌳🏜🏕🌺🌞\n"
]
Expand Down Expand Up @@ -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"
]
Expand Down Expand Up @@ -576,8 +576,8 @@
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
" Negative\n",
"2. Negative\n",
Expand Down Expand Up @@ -616,8 +616,8 @@
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
"0.5\n"
]
Expand Down Expand Up @@ -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"
]
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -795,8 +795,8 @@
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
" O(n^2*k)\n"
]
Expand Down Expand Up @@ -828,8 +828,8 @@
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
" \n",
"\n",
Expand Down Expand Up @@ -877,4 +877,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}

0 comments on commit c5dbb64

Please sign in to comment.