From aa377ecf0185c0cda5f9c755c97efc15c6cf7f7f Mon Sep 17 00:00:00 2001 From: Khan 'Sadh' Mostafa Date: Sun, 24 Dec 2023 00:37:27 -0800 Subject: [PATCH 1/4] Replace pannel with modern spelling panel --- templates/aistudio_gemini_prompt_chat.ipynb | 156 +++++++-------- .../aistudio_gemini_prompt_freeform.ipynb | 178 +++++++++--------- .../aistudio_gemini_prompt_freeform_b64.ipynb | 2 +- templates/makersuite_chat_prompt.ipynb | 4 +- 4 files changed, 170 insertions(+), 170 deletions(-) diff --git a/templates/aistudio_gemini_prompt_chat.ipynb b/templates/aistudio_gemini_prompt_chat.ipynb index 273764cac..ef7a8ad40 100644 --- a/templates/aistudio_gemini_prompt_chat.ipynb +++ b/templates/aistudio_gemini_prompt_chat.ipynb @@ -32,32 +32,32 @@ }, { "cell_type": "markdown", - "source": [ - "## Setup" - ], "metadata": { "id": "FKwyTRdwB8aW" - } + }, + "source": [ + "## Setup" + ] }, { "cell_type": "markdown", - "source": [ - "### Install & import\n" - ], "metadata": { "id": "rlE8UqxrDIez" - } + }, + "source": [ + "### Install & import\n" + ] }, { "cell_type": "code", - "source": [ - "!pip install google-generativelanguage" - ], + "execution_count": null, "metadata": { "id": "cZiU4TKzznh9" }, - "execution_count": null, - "outputs": [] + "outputs": [], + "source": [ + "!pip install google-generativelanguage" + ] }, { "cell_type": "code", @@ -80,57 +80,57 @@ }, { "cell_type": "markdown", + "metadata": { + "id": "qZsRPVv1ITbh" + }, "source": [ "\n", "\n", "### Mount Google Drive" - ], - "metadata": { - "id": "qZsRPVv1ITbh" - } + ] }, { "cell_type": "code", - "source": [ - "from google.colab import drive\n", - "drive.mount('/gdrive')" - ], + "execution_count": null, "metadata": { "id": "d9-t_OkGoLIP" }, - "execution_count": null, - "outputs": [] + "outputs": [], + "source": [ + "from google.colab import drive\n", + "drive.mount('/gdrive')" + ] }, { "cell_type": "markdown", - "source": [ - "## Set the API key" - ], "metadata": { "id": "Fet3lFjdKHEM" - } + }, + "source": [ + "## Set the API key" + ] }, { "cell_type": "markdown", - "source": [ - "Add your API_KEY to the secrets manager in the left pannel \"🔑\"." - ], "metadata": { "id": "ZoRWILAtCzBE" - } + }, + "source": [ + "Add your API_KEY to the secrets manager in the left panel \"🔑\"." + ] }, { "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "LaLCwNlkCyQd" + }, + "outputs": [], "source": [ "from google.colab import userdata\n", "\n", "API_KEY=userdata.get('API_KEY')" - ], - "metadata": { - "id": "LaLCwNlkCyQd" - }, - "execution_count": null, - "outputs": [] + ] }, { "cell_type": "code", @@ -146,15 +146,20 @@ }, { "cell_type": "markdown", - "source": [ - "### Parse the arguments" - ], "metadata": { "id": "weo-o73WDpdm" - } + }, + "source": [ + "### Parse the arguments" + ] }, { "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "uIog-0SyDuIF" + }, + "outputs": [], "source": [ "import json\n", "\n", @@ -170,32 +175,27 @@ "\n", "\n", "stream = False" - ], - "metadata": { - "id": "uIog-0SyDuIF" - }, - "execution_count": null, - "outputs": [] + ] }, { "cell_type": "code", - "source": [ - "contents" - ], + "execution_count": null, "metadata": { "id": "wBS8xNhN0x62" }, - "execution_count": null, - "outputs": [] + "outputs": [], + "source": [ + "contents" + ] }, { "cell_type": "markdown", - "source": [ - "### Call the API" - ], "metadata": { "id": "E7zAD69vE92b" - } + }, + "source": [ + "### Call the API" + ] }, { "cell_type": "code", @@ -217,54 +217,54 @@ }, { "cell_type": "code", - "source": [ - "display(Markdown(response.text))" - ], + "execution_count": null, "metadata": { "id": "Lm3RXwYuGtZK" }, - "execution_count": null, - "outputs": [] + "outputs": [], + "source": [ + "display(Markdown(response.text))" + ] }, { "cell_type": "code", - "source": [ - "response.prompt_feedback" - ], + "execution_count": null, "metadata": { "id": "JbKuUc3NGxYD" }, - "execution_count": null, - "outputs": [] + "outputs": [], + "source": [ + "response.prompt_feedback" + ] }, { "cell_type": "code", - "source": [ - "response.candidates" - ], + "execution_count": null, "metadata": { "id": "SLAaIq3kgwwJ" }, - "execution_count": null, - "outputs": [] + "outputs": [], + "source": [ + "response.candidates" + ] }, { "cell_type": "code", - "source": [], + "execution_count": null, "metadata": { "id": "8kS1DntQ2TKM" }, - "execution_count": null, - "outputs": [] + "outputs": [], + "source": [] } ], "metadata": { "colab": { - "provenance": [], - "private_outputs": true, "collapsed_sections": [ "Tce3stUlHN0L" - ] + ], + "private_outputs": true, + "provenance": [] }, "kernelspec": { "display_name": "Python 3", @@ -273,4 +273,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +} diff --git a/templates/aistudio_gemini_prompt_freeform.ipynb b/templates/aistudio_gemini_prompt_freeform.ipynb index 228dbadc5..835184d4f 100644 --- a/templates/aistudio_gemini_prompt_freeform.ipynb +++ b/templates/aistudio_gemini_prompt_freeform.ipynb @@ -32,32 +32,32 @@ }, { "cell_type": "markdown", - "source": [ - "## Setup" - ], "metadata": { "id": "FKwyTRdwB8aW" - } + }, + "source": [ + "## Setup" + ] }, { "cell_type": "markdown", - "source": [ - "### Install & import" - ], "metadata": { "id": "rlE8UqxrDIez" - } + }, + "source": [ + "### Install & import" + ] }, { "cell_type": "code", - "source": [ - "!pip install google-generativelanguage" - ], + "execution_count": null, "metadata": { "id": "RXInneX6xx7c" }, - "execution_count": null, - "outputs": [] + "outputs": [], + "source": [ + "!pip install google-generativelanguage" + ] }, { "cell_type": "code", @@ -80,57 +80,57 @@ }, { "cell_type": "markdown", + "metadata": { + "id": "qZsRPVv1ITbh" + }, "source": [ "\n", "\n", "### Mount Google Drive" - ], - "metadata": { - "id": "qZsRPVv1ITbh" - } + ] }, { "cell_type": "code", - "source": [ - "from google.colab import drive\n", - "drive.mount('/gdrive')" - ], + "execution_count": null, "metadata": { "id": "d9-t_OkGoLIP" }, - "execution_count": null, - "outputs": [] + "outputs": [], + "source": [ + "from google.colab import drive\n", + "drive.mount('/gdrive')" + ] }, { "cell_type": "markdown", - "source": [ - "## Set the API key" - ], "metadata": { "id": "Fet3lFjdKHEM" - } + }, + "source": [ + "## Set the API key" + ] }, { "cell_type": "markdown", - "source": [ - "Add your API_KEY to the secrets manager in the left pannel \"🔑\"." - ], "metadata": { "id": "ZoRWILAtCzBE" - } + }, + "source": [ + "Add your API_KEY to the secrets manager in the left panel \"🔑\"." + ] }, { "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "LaLCwNlkCyQd" + }, + "outputs": [], "source": [ "from google.colab import userdata\n", "\n", "API_KEY=userdata.get('API_KEY')" - ], - "metadata": { - "id": "LaLCwNlkCyQd" - }, - "execution_count": null, - "outputs": [] + ] }, { "cell_type": "code", @@ -146,15 +146,20 @@ }, { "cell_type": "markdown", - "source": [ - "### Parse the arguments" - ], "metadata": { "id": "weo-o73WDpdm" - } + }, + "source": [ + "### Parse the arguments" + ] }, { "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "uIog-0SyDuIF" + }, + "outputs": [], "source": [ "import json\n", "\n", @@ -168,35 +173,35 @@ "safety_settings = json.loads(safety_settings)\n", "\n", "stream = False" - ], - "metadata": { - "id": "uIog-0SyDuIF" - }, - "execution_count": null, - "outputs": [] + ] }, { "cell_type": "code", - "source": [ - "contents" - ], + "execution_count": null, "metadata": { "id": "T3yo4eMqyWEZ" }, - "execution_count": null, - "outputs": [] + "outputs": [], + "source": [ + "contents" + ] }, { "cell_type": "markdown", - "source": [ - "### Load image data from Drive-IDs" - ], "metadata": { "id": "yVIjklecE5U0" - } + }, + "source": [ + "### Load image data from Drive-IDs" + ] }, { "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "8TehY-utE3OR" + }, + "outputs": [], "source": [ "for content in contents:\n", " for n, part in enumerate(content['parts']):\n", @@ -218,21 +223,16 @@ "\n", " blob = {'data': data, 'mime_type': mime_type}\n", " content['parts'][n] = blob" - ], - "metadata": { - "id": "8TehY-utE3OR" - }, - "execution_count": null, - "outputs": [] + ] }, { "cell_type": "markdown", - "source": [ - "### Call the API" - ], "metadata": { "id": "E7zAD69vE92b" - } + }, + "source": [ + "### Call the API" + ] }, { "cell_type": "code", @@ -254,57 +254,57 @@ }, { "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "Lm3RXwYuGtZK" + }, + "outputs": [], "source": [ "if generation_config.get('candidate_count', 1) == 1:\n", " display(Markdown(response.text))\n", "else:\n", " print(response.candidates)" - ], - "metadata": { - "id": "Lm3RXwYuGtZK" - }, - "execution_count": null, - "outputs": [] + ] }, { "cell_type": "code", - "source": [ - "response.candidates" - ], + "execution_count": null, "metadata": { "id": "HjT4jtJc2aAk" }, - "execution_count": null, - "outputs": [] + "outputs": [], + "source": [ + "response.candidates" + ] }, { "cell_type": "code", - "source": [ - "response.prompt_feedback" - ], + "execution_count": null, "metadata": { "id": "JbKuUc3NGxYD" }, - "execution_count": null, - "outputs": [] + "outputs": [], + "source": [ + "response.prompt_feedback" + ] }, { "cell_type": "code", - "source": [], + "execution_count": null, "metadata": { "id": "SLAaIq3kgwwJ" }, - "execution_count": null, - "outputs": [] + "outputs": [], + "source": [] } ], "metadata": { "colab": { - "provenance": [], - "private_outputs": true, "collapsed_sections": [ "Tce3stUlHN0L" - ] + ], + "private_outputs": true, + "provenance": [] }, "kernelspec": { "display_name": "Python 3", @@ -313,4 +313,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +} diff --git a/templates/aistudio_gemini_prompt_freeform_b64.ipynb b/templates/aistudio_gemini_prompt_freeform_b64.ipynb index 942dae905..923d0460d 100644 --- a/templates/aistudio_gemini_prompt_freeform_b64.ipynb +++ b/templates/aistudio_gemini_prompt_freeform_b64.ipynb @@ -131,7 +131,7 @@ "id": "ZoRWILAtCzBE" }, "source": [ - "Add your API_KEY to the secrets manager in the left pannel \"🔑\"." + "Add your API_KEY to the secrets manager in the left panel \"🔑\"." ] }, { diff --git a/templates/makersuite_chat_prompt.ipynb b/templates/makersuite_chat_prompt.ipynb index 703294828..2824f582a 100644 --- a/templates/makersuite_chat_prompt.ipynb +++ b/templates/makersuite_chat_prompt.ipynb @@ -118,8 +118,8 @@ ], "metadata": { "colab": { - "toc_visible": true, - "provenance": [] + "provenance": [], + "toc_visible": true }, "kernelspec": { "display_name": "Python 3", From a5f3efbbe4ccc14795f4c94350b054069ff66379 Mon Sep 17 00:00:00 2001 From: Mark Daoust Date: Thu, 11 Jan 2024 10:30:01 -0800 Subject: [PATCH 2/4] Fix json. --- templates/aistudio_gemini_prompt_chat.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/aistudio_gemini_prompt_chat.ipynb b/templates/aistudio_gemini_prompt_chat.ipynb index 809f0dae5..dbe8ac4c2 100644 --- a/templates/aistudio_gemini_prompt_chat.ipynb +++ b/templates/aistudio_gemini_prompt_chat.ipynb @@ -246,7 +246,7 @@ "source": [ "response.candidates" ] - }, + } ], "metadata": { "colab": { From 133077c4d86ab5adcd906d6b43dcc2e24982459c Mon Sep 17 00:00:00 2001 From: Mark Daoust Date: Thu, 11 Jan 2024 10:30:11 -0800 Subject: [PATCH 3/4] Fix json --- templates/aistudio_gemini_prompt_chat.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/aistudio_gemini_prompt_chat.ipynb b/templates/aistudio_gemini_prompt_chat.ipynb index dbe8ac4c2..0c606f1a1 100644 --- a/templates/aistudio_gemini_prompt_chat.ipynb +++ b/templates/aistudio_gemini_prompt_chat.ipynb @@ -256,7 +256,7 @@ "private_outputs": true, "provenance": [], "name": "aistudio_gemini_prompt_chat.ipynb", - "toc_visible": true, + "toc_visible": true }, "kernelspec": { "display_name": "Python 3", From 4aca9b579de1edb89a6ccda4f0ef3a6af1b6b40c Mon Sep 17 00:00:00 2001 From: Mark Daoust Date: Thu, 11 Jan 2024 10:33:37 -0800 Subject: [PATCH 4/4] format --- templates/aistudio_gemini_prompt_chat.ipynb | 2 -- templates/aistudio_gemini_prompt_freeform.ipynb | 2 -- templates/makersuite_chat_prompt.ipynb | 1 - 3 files changed, 5 deletions(-) diff --git a/templates/aistudio_gemini_prompt_chat.ipynb b/templates/aistudio_gemini_prompt_chat.ipynb index 0c606f1a1..f05ea511f 100644 --- a/templates/aistudio_gemini_prompt_chat.ipynb +++ b/templates/aistudio_gemini_prompt_chat.ipynb @@ -253,8 +253,6 @@ "collapsed_sections": [ "Tce3stUlHN0L" ], - "private_outputs": true, - "provenance": [], "name": "aistudio_gemini_prompt_chat.ipynb", "toc_visible": true }, diff --git a/templates/aistudio_gemini_prompt_freeform.ipynb b/templates/aistudio_gemini_prompt_freeform.ipynb index 371b61247..31dfaf1fd 100644 --- a/templates/aistudio_gemini_prompt_freeform.ipynb +++ b/templates/aistudio_gemini_prompt_freeform.ipynb @@ -293,8 +293,6 @@ "collapsed_sections": [ "Tce3stUlHN0L" ], - "private_outputs": true, - "provenance": [], "name": "aistudio_gemini_prompt_freeform.ipynb", "toc_visible": true }, diff --git a/templates/makersuite_chat_prompt.ipynb b/templates/makersuite_chat_prompt.ipynb index 9be8b293f..5eac8bf97 100644 --- a/templates/makersuite_chat_prompt.ipynb +++ b/templates/makersuite_chat_prompt.ipynb @@ -118,7 +118,6 @@ ], "metadata": { "colab": { - "provenance": [], "name": "makersuite_chat_prompt.ipynb", "toc_visible": true },