diff --git a/Gemma/Keras_Gemma_2_Quickstart.ipynb b/Gemma/Keras_Gemma_2_Quickstart.ipynb new file mode 100644 index 0000000..6439abb --- /dev/null +++ b/Gemma/Keras_Gemma_2_Quickstart.ipynb @@ -0,0 +1,335 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "PXNm5_p_oxMF" + }, + "source": [ + "This is a quick demo of Gemma running on KerasNLP. To run this you will need:\n", + "- To be added to a private github repo for Gemma.\n", + "- To be added to a private Kaggle model for weights.\n", + "\n", + "General Keras reading:\n", + "- [Getting started with Keras](https://keras.io/getting_started/)\n", + "- [Getting started with KerasNLP](https://keras.io/guides/keras_nlp/getting_started/)\n", + "- [Generation and fine-tuning guide for GPT2](https://keras.io/guides/keras_nlp/getting_started/)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "VzFhJDayXroT" + }, + "source": [ + "## Access" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "id": "DrBoa_Urw9Vx" + }, + "outputs": [], + "source": [ + "import os\n", + "from google.colab import userdata\n", + "\n", + "os.environ[\"KAGGLE_USERNAME\"] = userdata.get('KAGGLE_USERNAME')\n", + "os.environ[\"KAGGLE_KEY\"] = userdata.get('KAGGLE_KEY')" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "z9oy3QUmXtSd" + }, + "source": [ + "## Installation" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "bMboT70Xop8G", + "outputId": "f515845e-a15d-4c52-ace4-56944d48045b" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n", + " Getting requirements to build wheel ... \u001b[?25l\u001b[?25hdone\n", + " Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.1/1.1 MB\u001b[0m \u001b[31m21.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.2/5.2 MB\u001b[0m \u001b[31m72.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m311.2/311.2 kB\u001b[0m \u001b[31m35.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m589.8/589.8 MB\u001b[0m \u001b[31m2.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.3/5.3 MB\u001b[0m \u001b[31m95.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.2/2.2 MB\u001b[0m \u001b[31m76.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.5/5.5 MB\u001b[0m \u001b[31m107.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25h Building wheel for keras-nlp (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n", + "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", + "tf-keras 2.15.1 requires tensorflow<2.16,>=2.15, but you have tensorflow 2.16.1 which is incompatible.\u001b[0m\u001b[31m\n", + "\u001b[0m" + ] + } + ], + "source": [ + "# Install all deps\n", + "!pip install keras\n", + "!pip install keras-nlp" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "FX47AUYrXwLK" + }, + "source": [ + "## Quickstart" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "id": "ww83zI9ToPso" + }, + "outputs": [], + "source": [ + "import os\n", + "\n", + "os.environ[\"KERAS_BACKEND\"] = \"jax\" # Or \"tensorflow\" or \"torch\".\n", + "\n", + "import keras_nlp\n", + "import keras\n", + "\n", + "# Run at half precision.\n", + "keras.config.set_floatx(\"bfloat16\")" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 605 + }, + "id": "yygIK9DEIldp", + "outputId": "93e3ca01-4770-4e27-fc7f-fb86a6b83bae" + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/3/download/metadata.json...\n", + "100%|██████████| 143/143 [00:00<00:00, 179kB/s]\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/3/download/task.json...\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/3/download/config.json...\n", + "100%|██████████| 780/780 [00:00<00:00, 895kB/s]\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/3/download/model.weights.h5...\n", + "100%|██████████| 17.2G/17.2G [18:34<00:00, 16.6MB/s]\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/3/download/preprocessor.json...\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/3/download/tokenizer.json...\n", + "100%|██████████| 315/315 [00:00<00:00, 431kB/s]\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/3/download/assets/tokenizer/vocabulary.spm...\n", + "100%|██████████| 4.04M/4.04M [00:01<00:00, 2.41MB/s]\n" + ] + }, + { + "data": { + "text/html": [ + "
Preprocessor: \"gemma_causal_lm_preprocessor\"\n",
+              "
\n" + ], + "text/plain": [ + "\u001b[1mPreprocessor: \"gemma_causal_lm_preprocessor\"\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n",
+              "┃ Tokenizer (type)                                                                                Vocab # ┃\n",
+              "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
+              "│ gemma_tokenizer (GemmaTokenizer)                   │                                             256,000 │\n",
+              "└────────────────────────────────────────────────────┴─────────────────────────────────────────────────────┘\n",
+              "
\n" + ], + "text/plain": [ + "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n", + "┃\u001b[1m \u001b[0m\u001b[1mTokenizer (type) \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m Vocab #\u001b[0m\u001b[1m \u001b[0m┃\n", + "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n", + "│ gemma_tokenizer (\u001b[38;5;33mGemmaTokenizer\u001b[0m) │ \u001b[38;5;34m256,000\u001b[0m │\n", + "└────────────────────────────────────────────────────┴─────────────────────────────────────────────────────┘\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
Model: \"gemma_causal_lm\"\n",
+              "
\n" + ], + "text/plain": [ + "\u001b[1mModel: \"gemma_causal_lm\"\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n",
+              "┃ Layer (type)                   Output Shape                       Param #  Connected to               ┃\n",
+              "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
+              "│ padding_mask (InputLayer)     │ (None, None)              │               0 │ -                          │\n",
+              "├───────────────────────────────┼───────────────────────────┼─────────────────┼────────────────────────────┤\n",
+              "│ token_ids (InputLayer)        │ (None, None)              │               0 │ -                          │\n",
+              "├───────────────────────────────┼───────────────────────────┼─────────────────┼────────────────────────────┤\n",
+              "│ gemma_backbone                │ (None, None, 3584)        │   9,241,705,984 │ padding_mask[0][0],        │\n",
+              "│ (GemmaBackbone)               │                           │                 │ token_ids[0][0]            │\n",
+              "├───────────────────────────────┼───────────────────────────┼─────────────────┼────────────────────────────┤\n",
+              "│ token_embedding               │ (None, None, 256000)      │     917,504,000 │ gemma_backbone[0][0]       │\n",
+              "│ (ReversibleEmbedding)         │                           │                 │                            │\n",
+              "└───────────────────────────────┴───────────────────────────┴─────────────────┴────────────────────────────┘\n",
+              "
\n" + ], + "text/plain": [ + "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n", + "┃\u001b[1m \u001b[0m\u001b[1mLayer (type) \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mOutput Shape \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m Param #\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mConnected to \u001b[0m\u001b[1m \u001b[0m┃\n", + "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n", + "│ padding_mask (\u001b[38;5;33mInputLayer\u001b[0m) │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;45mNone\u001b[0m) │ \u001b[38;5;34m0\u001b[0m │ - │\n", + "├───────────────────────────────┼───────────────────────────┼─────────────────┼────────────────────────────┤\n", + "│ token_ids (\u001b[38;5;33mInputLayer\u001b[0m) │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;45mNone\u001b[0m) │ \u001b[38;5;34m0\u001b[0m │ - │\n", + "├───────────────────────────────┼───────────────────────────┼─────────────────┼────────────────────────────┤\n", + "│ gemma_backbone │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m3584\u001b[0m) │ \u001b[38;5;34m9,241,705,984\u001b[0m │ padding_mask[\u001b[38;5;34m0\u001b[0m][\u001b[38;5;34m0\u001b[0m], │\n", + "│ (\u001b[38;5;33mGemmaBackbone\u001b[0m) │ │ │ token_ids[\u001b[38;5;34m0\u001b[0m][\u001b[38;5;34m0\u001b[0m] │\n", + "├───────────────────────────────┼───────────────────────────┼─────────────────┼────────────────────────────┤\n", + "│ token_embedding │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m256000\u001b[0m) │ \u001b[38;5;34m917,504,000\u001b[0m │ gemma_backbone[\u001b[38;5;34m0\u001b[0m][\u001b[38;5;34m0\u001b[0m] │\n", + "│ (\u001b[38;5;33mReversibleEmbedding\u001b[0m) │ │ │ │\n", + "└───────────────────────────────┴───────────────────────────┴─────────────────┴────────────────────────────┘\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
 Total params: 9,241,705,984 (17.21 GB)\n",
+              "
\n" + ], + "text/plain": [ + "\u001b[1m Total params: \u001b[0m\u001b[38;5;34m9,241,705,984\u001b[0m (17.21 GB)\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
 Trainable params: 9,241,705,984 (17.21 GB)\n",
+              "
\n" + ], + "text/plain": [ + "\u001b[1m Trainable params: \u001b[0m\u001b[38;5;34m9,241,705,984\u001b[0m (17.21 GB)\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
 Non-trainable params: 0 (0.00 B)\n",
+              "
\n" + ], + "text/plain": [ + "\u001b[1m Non-trainable params: \u001b[0m\u001b[38;5;34m0\u001b[0m (0.00 B)\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# Connect using the default `gemma2_9b_keras` or through huggingface weights `hf://google/gemma-2-9b-keras`\n", + "gemma_lm = keras_nlp.models.GemmaCausalLM.from_preset(\"gemma2_9b_en\")\n", + "gemma_lm.summary()" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 35 + }, + "id": "aae5GHrdpj2_", + "outputId": "fa242464-a217-4a7b-901e-27b00d0e995b" + }, + "outputs": [ + { + "data": { + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + }, + "text/plain": [ + "'What is the meaning of life?\\n\\n[Answer 1]\\n\\nThe meaning of life is to live it.\\n\\n[Answer 2]\\n\\nThe'" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "gemma_lm.generate(\"What is the meaning of life?\", max_length=32)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "Sb5uZ0BLv8Ot" + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "accelerator": "GPU", + "colab": { + "gpuType": "A100", + "machine_shape": "hm", + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "name": "python3" + }, + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Gemma/Keras_Gemma_2_Quickstart_Chat.ipynb b/Gemma/Keras_Gemma_2_Quickstart_Chat.ipynb new file mode 100644 index 0000000..bb7b46b --- /dev/null +++ b/Gemma/Keras_Gemma_2_Quickstart_Chat.ipynb @@ -0,0 +1,1256 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "PXNm5_p_oxMF" + }, + "source": [ + "This is a quick demo of Gemma running on KerasNLP. To run this you will need:\n", + "- To be added to a private github repo for Gemma.\n", + "- To be added to a private Kaggle model for weights.\n", + "\n", + "General Keras reading:\n", + "- [Getting started with Keras](https://keras.io/getting_started/)\n", + "- [Getting started with KerasNLP](https://keras.io/guides/keras_nlp/getting_started/)\n", + "- [Generation and fine-tuning guide for GPT2](https://keras.io/guides/keras_nlp/getting_started/)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "VzFhJDayXroT" + }, + "source": [ + "## Access" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "id": "DrBoa_Urw9Vx" + }, + "outputs": [], + "source": [ + "import os\n", + "from google.colab import userdata\n", + "\n", + "os.environ[\"KAGGLE_USERNAME\"] = userdata.get('KAGGLE_USERNAME')\n", + "os.environ[\"KAGGLE_KEY\"] = userdata.get('KAGGLE_KEY')" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "z9oy3QUmXtSd" + }, + "source": [ + "## Installation" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "UehUHTaZmK0n" + }, + "outputs": [], + "source": [ + "# Install all deps\n", + "!pip install keras\n", + "!pip install keras-nlp" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "FX47AUYrXwLK" + }, + "source": [ + "## Quickstart" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "id": "ww83zI9ToPso" + }, + "outputs": [], + "source": [ + "os.environ[\"KERAS_BACKEND\"] = \"jax\" # Or \"tensorflow\" or \"torch\".\n", + "import os\n", + "import textwrap\n", + "\n", + "import keras_nlp\n", + "import keras\n", + "\n", + "from IPython.display import Markdown" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "id": "UhbtacN1yqe4" + }, + "outputs": [], + "source": [ + "# Run at half precision.\n", + "keras.config.set_floatx(\"bfloat16\")\n", + "\n", + "def to_markdown(text):\n", + " text = text.replace('•', ' *')\n", + " return Markdown(textwrap.indent(text, '> ', predicate=lambda _: True))" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 605 + }, + "id": "yygIK9DEIldp", + "outputId": "26b639b4-0f0c-47c0-8418-237bf14ebbc9" + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/metadata.json...\n", + "100%|██████████| 143/143 [00:00<00:00, 173kB/s]\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/task.json...\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/config.json...\n", + "100%|██████████| 780/780 [00:00<00:00, 1.16MB/s]\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/model.weights.h5...\n", + "100%|██████████| 17.2G/17.2G [18:19<00:00, 16.8MB/s]\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/preprocessor.json...\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/tokenizer.json...\n", + "100%|██████████| 315/315 [00:00<00:00, 781kB/s]\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/assets/tokenizer/vocabulary.spm...\n", + "100%|██████████| 4.04M/4.04M [00:01<00:00, 2.40MB/s]\n" + ] + }, + { + "data": { + "text/html": [ + "
Preprocessor: \"gemma_causal_lm_preprocessor\"\n",
+              "
\n" + ], + "text/plain": [ + "\u001b[1mPreprocessor: \"gemma_causal_lm_preprocessor\"\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n",
+              "┃ Tokenizer (type)                                                                                Vocab # ┃\n",
+              "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
+              "│ gemma_tokenizer (GemmaTokenizer)                   │                                             256,000 │\n",
+              "└────────────────────────────────────────────────────┴─────────────────────────────────────────────────────┘\n",
+              "
\n" + ], + "text/plain": [ + "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n", + "┃\u001b[1m \u001b[0m\u001b[1mTokenizer (type) \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m Vocab #\u001b[0m\u001b[1m \u001b[0m┃\n", + "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n", + "│ gemma_tokenizer (\u001b[38;5;33mGemmaTokenizer\u001b[0m) │ \u001b[38;5;34m256,000\u001b[0m │\n", + "└────────────────────────────────────────────────────┴─────────────────────────────────────────────────────┘\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
Model: \"gemma_causal_lm\"\n",
+              "
\n" + ], + "text/plain": [ + "\u001b[1mModel: \"gemma_causal_lm\"\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n",
+              "┃ Layer (type)                   Output Shape                       Param #  Connected to               ┃\n",
+              "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
+              "│ padding_mask (InputLayer)     │ (None, None)              │               0 │ -                          │\n",
+              "├───────────────────────────────┼───────────────────────────┼─────────────────┼────────────────────────────┤\n",
+              "│ token_ids (InputLayer)        │ (None, None)              │               0 │ -                          │\n",
+              "├───────────────────────────────┼───────────────────────────┼─────────────────┼────────────────────────────┤\n",
+              "│ gemma_backbone                │ (None, None, 3584)        │   9,241,705,984 │ padding_mask[0][0],        │\n",
+              "│ (GemmaBackbone)               │                           │                 │ token_ids[0][0]            │\n",
+              "├───────────────────────────────┼───────────────────────────┼─────────────────┼────────────────────────────┤\n",
+              "│ token_embedding               │ (None, None, 256000)      │     917,504,000 │ gemma_backbone[0][0]       │\n",
+              "│ (ReversibleEmbedding)         │                           │                 │                            │\n",
+              "└───────────────────────────────┴───────────────────────────┴─────────────────┴────────────────────────────┘\n",
+              "
\n" + ], + "text/plain": [ + "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n", + "┃\u001b[1m \u001b[0m\u001b[1mLayer (type) \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mOutput Shape \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m Param #\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mConnected to \u001b[0m\u001b[1m \u001b[0m┃\n", + "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n", + "│ padding_mask (\u001b[38;5;33mInputLayer\u001b[0m) │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;45mNone\u001b[0m) │ \u001b[38;5;34m0\u001b[0m │ - │\n", + "├───────────────────────────────┼───────────────────────────┼─────────────────┼────────────────────────────┤\n", + "│ token_ids (\u001b[38;5;33mInputLayer\u001b[0m) │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;45mNone\u001b[0m) │ \u001b[38;5;34m0\u001b[0m │ - │\n", + "├───────────────────────────────┼───────────────────────────┼─────────────────┼────────────────────────────┤\n", + "│ gemma_backbone │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m3584\u001b[0m) │ \u001b[38;5;34m9,241,705,984\u001b[0m │ padding_mask[\u001b[38;5;34m0\u001b[0m][\u001b[38;5;34m0\u001b[0m], │\n", + "│ (\u001b[38;5;33mGemmaBackbone\u001b[0m) │ │ │ token_ids[\u001b[38;5;34m0\u001b[0m][\u001b[38;5;34m0\u001b[0m] │\n", + "├───────────────────────────────┼───────────────────────────┼─────────────────┼────────────────────────────┤\n", + "│ token_embedding │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m256000\u001b[0m) │ \u001b[38;5;34m917,504,000\u001b[0m │ gemma_backbone[\u001b[38;5;34m0\u001b[0m][\u001b[38;5;34m0\u001b[0m] │\n", + "│ (\u001b[38;5;33mReversibleEmbedding\u001b[0m) │ │ │ │\n", + "└───────────────────────────────┴───────────────────────────┴─────────────────┴────────────────────────────┘\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
 Total params: 9,241,705,984 (17.21 GB)\n",
+              "
\n" + ], + "text/plain": [ + "\u001b[1m Total params: \u001b[0m\u001b[38;5;34m9,241,705,984\u001b[0m (17.21 GB)\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
 Trainable params: 9,241,705,984 (17.21 GB)\n",
+              "
\n" + ], + "text/plain": [ + "\u001b[1m Trainable params: \u001b[0m\u001b[38;5;34m9,241,705,984\u001b[0m (17.21 GB)\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
 Non-trainable params: 0 (0.00 B)\n",
+              "
\n" + ], + "text/plain": [ + "\u001b[1m Non-trainable params: \u001b[0m\u001b[38;5;34m0\u001b[0m (0.00 B)\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# Connect using the default `gemma2_instruct_9b_keras` or through huggingface weights `hf://google/gemma-2-9b-keras`\n", + "gemma_lm = keras_nlp.models.GemmaCausalLM.from_preset(\"gemma2_instruct_9b_en\")\n", + "gemma_lm.summary()" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 347 + }, + "id": "aae5GHrdpj2_", + "outputId": "6c2b7977-5bae-4cfb-fa97-4d56fd8dd1d1" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "CPU times: user 56.7 s, sys: 627 ms, total: 57.3 s\n", + "Wall time: 37.3 s\n" + ] + }, + { + "data": { + "text/markdown": [ + "> what is the meaning of life?.\n", + "> \n", + "> That's a question that has been pondered by philosophers and theologians for centuries, and there's no one answer that will satisfy everyone. \n", + "> \n", + "> Here are some perspectives to consider:\n", + "> \n", + "> * **Meaning is created, not found:** Many believe that life has no inherent meaning, and it's up to each individual to create their own purpose and find what gives their life value. This could involve pursuing passions, building relationships, contributing to society, or simply enjoying the experience of being alive.\n", + "> * **Meaning is found in connection:** Others find meaning in their connections with others, whether it's through family, friends, community, or a sense of belonging to something larger than themselves.\n", + "> \n", + "> * **Meaning is found in service:** Some find meaning in helping others and making a difference in the world. This could involve volunteering, activism, or simply being kind and compassionate to those around them.\n", + "> * **Meaning is found in the journey:** Some believe that the meaning of life is not about reaching a specific destination, but about the journey itself. This involves embracing the challenges and joys of life, learning and growing along the way, and appreciating the present moment.\n", + "> \n", + "> Ultimately, the meaning of life is a deeply personal question." + ], + "text/plain": [ + "" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "%time result = gemma_lm.generate(\"what is the meaning of life?.\", max_length=256)\n", + "to_markdown(result)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "id": "O0TkvhOASI9f" + }, + "outputs": [], + "source": [ + "class GemmaChat():\n", + "\n", + " __START_TURN__ = \"\"\n", + " __END_TURN__ = \"\"\n", + " __SYSTEM_STOP__ = \"\"\n", + "\n", + " def __init__(self, model, system=\"\", history=None):\n", + " self.model = model\n", + " self.system = system\n", + " if not history:\n", + " self.history = []\n", + " else:\n", + " self.history = history\n", + "\n", + " def format_message(self, message, prefix=\"\"):\n", + " return f\"{self.__START_TURN__}{prefix}\\n{message}{self.__END_TURN__}\\n\"\n", + "\n", + " def add_to_history(self, message, prefix=\"\"):\n", + " formated_message = self.format_message(message, prefix)\n", + " self.history.append(formated_message)\n", + "\n", + " def get_full_prompt(self):\n", + " prompt = \"\\n\".join([self.system + \"\\n\", *self.history])\n", + " return prompt\n", + "\n", + " def send_message(self, message):\n", + " self.add_to_history(message, \"user\")\n", + " prompt = self.get_full_prompt()\n", + " response = self.model.generate(prompt, max_length=2048)\n", + " # print('--------------------response---------------------------')\n", + " # print(response)\n", + " # print('--------------------response---------------------------')\n", + " result = response.replace(prompt, \"\")\n", + " result = response.replace(self.__SYSTEM_STOP__, \"\")\n", + " self.add_to_history(result, \"model\")\n", + " return result\n", + "\n", + " def show_history(self):\n", + " for h in self.history:\n", + " print(h)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 907 + }, + "id": "shfCZDFPKghT", + "outputId": "602c6b74-d67a-4281-ae79-be553d37ec28" + }, + "outputs": [ + { + "data": { + "text/markdown": [ + "> \n", + "> \n", + "> user\n", + "> help me understand how to make coffee\n", + "> \n", + "> \n", + "> ## Let's Brew Some Coffee! ☕️\n", + "> \n", + "> Making coffee is a simple process, but there are many ways to do it. Here's a breakdown of some popular methods:\n", + "> \n", + "> **1. Drip Coffee Maker:**\n", + "> \n", + "> * **What you need:** Drip coffee maker, coffee filter, ground coffee, water.\n", + "> * **How to do it:**\n", + "> 1. Fill the water reservoir with fresh, cold water.\n", + "> 2. Place a filter in the filter basket.\n", + "> 3. Add ground coffee to the filter (follow the coffee maker's instructions for the right amount).\n", + "> 4. Turn on the coffee maker and let it brew.\n", + "> 5. Enjoy your freshly brewed coffee!\n", + "> \n", + "> **2. French Press:**\n", + "> \n", + "> * **What you need:** French press, coarse ground coffee, hot water.\n", + "> * **How to do it:**\n", + "> 1. Heat water to just off the boil (around 200°F).\n", + "> 2. Add coarse ground coffee to the French press.\n", + "> 3. Pour hot water over the coffee grounds, making sure all grounds are saturated.\n", + "> 4. Stir gently and place the lid on the press, but don't plunge yet.\n", + "> 5. Let the coffee steep for 4 minutes.\n", + "> 6. Slowly press the plunger down to separate the grounds from the brewed coffee.\n", + "> 7. Pour and enjoy!\n", + "> \n", + "> **3. Pour Over:**\n", + "> \n", + "> * **What you need:** Pour over cone, filter, medium-fine ground coffee, hot water.\n", + "> * **How to do it:**\n", + "> 1. Place a filter in the cone and rinse it with hot water to remove any paper taste.\n", + "> 2. Add medium-fine ground coffee to the filter.\n", + "> 3. Slowly pour hot water over the coffee grounds in a circular motion, making sure all grounds are saturated.\n", + "> 4. Let the coffee drip through into your cup.\n", + "> 5. Enjoy!\n", + "> \n", + "> **4. Cold Brew:**\n", + "> \n", + "> * **What you need:** Coarse ground coffee, cold water, container.\n", + "> * **How to do it:**\n", + "> 1. Combine coarse ground coffee and cold water in a container (ratio of 1:8 coffee to water).\n", + "> 2. Stir well and cover the container.\n", + "> 3. Let the coffee steep in the refrigerator for 12-24 hours.\n", + "> 4. Strain the coffee through a fine-mesh sieve or cheesecloth.\n", + "> 5. Serve over ice and enjoy!\n", + "> \n", + "> **Tips for Better Coffee:**\n", + "> \n", + "> * **Use fresh, high-quality beans:** The better the beans, the better the coffee.\n", + "> * **Grind your beans right before brewing:** This preserves the flavor and aroma.\n", + "> * **Use filtered water:** Impurities in water can affect the taste of your coffee.\n", + "> * **Experiment with different brewing methods:** Find the method that you enjoy the most.\n", + "> * **Clean your coffee maker regularly:** This will help to prevent buildup and ensure that your coffee tastes its best.\n", + "> \n", + "> \n", + "> \n", + "> Let me know if you have any other questions or want to explore a specific brewing method in more detail!\n" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chat = GemmaChat(gemma_lm)\n", + "result = chat.send_message(\"help me understand how to make coffee\")\n", + "to_markdown(result)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000 + }, + "id": "bLxtlhjtLkWQ", + "outputId": "665e5de2-9b1a-4ed4-c11f-e6e1d82599d9" + }, + "outputs": [ + { + "data": { + "text/markdown": [ + "> \n", + "> \n", + "> user\n", + "> help me understand how to make coffee\n", + "> \n", + "> model\n", + "> \n", + "> \n", + "> user\n", + "> help me understand how to make coffee\n", + "> \n", + "> \n", + "> ## Let's Brew Some Coffee! ☕️\n", + "> \n", + "> Making coffee is a simple process, but there are many ways to do it. Here's a breakdown of some popular methods:\n", + "> \n", + "> **1. Drip Coffee Maker:**\n", + "> \n", + "> * **What you need:** Drip coffee maker, coffee filter, ground coffee, water.\n", + "> * **How to do it:**\n", + "> 1. Fill the water reservoir with fresh, cold water.\n", + "> 2. Place a filter in the filter basket.\n", + "> 3. Add ground coffee to the filter (follow the coffee maker's instructions for the right amount).\n", + "> 4. Turn on the coffee maker and let it brew.\n", + "> 5. Enjoy your freshly brewed coffee!\n", + "> \n", + "> **2. French Press:**\n", + "> \n", + "> * **What you need:** French press, coarse ground coffee, hot water.\n", + "> * **How to do it:**\n", + "> 1. Heat water to just off the boil (around 200°F).\n", + "> 2. Add coarse ground coffee to the French press.\n", + "> 3. Pour hot water over the coffee grounds, making sure all grounds are saturated.\n", + "> 4. Stir gently and place the lid on the press, but don't plunge yet.\n", + "> 5. Let the coffee steep for 4 minutes.\n", + "> 6. Slowly press the plunger down to separate the grounds from the brewed coffee.\n", + "> 7. Pour and enjoy!\n", + "> \n", + "> **3. Pour Over:**\n", + "> \n", + "> * **What you need:** Pour over cone, filter, medium-fine ground coffee, hot water.\n", + "> * **How to do it:**\n", + "> 1. Place a filter in the cone and rinse it with hot water to remove any paper taste.\n", + "> 2. Add medium-fine ground coffee to the filter.\n", + "> 3. Slowly pour hot water over the coffee grounds in a circular motion, making sure all grounds are saturated.\n", + "> 4. Let the coffee drip through into your cup.\n", + "> 5. Enjoy!\n", + "> \n", + "> **4. Cold Brew:**\n", + "> \n", + "> * **What you need:** Coarse ground coffee, cold water, container.\n", + "> * **How to do it:**\n", + "> 1. Combine coarse ground coffee and cold water in a container (ratio of 1:8 coffee to water).\n", + "> 2. Stir well and cover the container.\n", + "> 3. Let the coffee steep in the refrigerator for 12-24 hours.\n", + "> 4. Strain the coffee through a fine-mesh sieve or cheesecloth.\n", + "> 5. Serve over ice and enjoy!\n", + "> \n", + "> **Tips for Better Coffee:**\n", + "> \n", + "> * **Use fresh, high-quality beans:** The better the beans, the better the coffee.\n", + "> * **Grind your beans right before brewing:** This preserves the flavor and aroma.\n", + "> * **Use filtered water:** Impurities in water can affect the taste of your coffee.\n", + "> * **Experiment with different brewing methods:** Find the method that you enjoy the most.\n", + "> * **Clean your coffee maker regularly:** This will help to prevent buildup and ensure that your coffee tastes its best.\n", + "> \n", + "> \n", + "> \n", + "> Let me know if you have any other questions or want to explore a specific brewing method in more detail!\n", + "> \n", + "> \n", + "> user\n", + "> what is the best coffee?\n", + "> \n", + "> \n", + "> Ah, the eternal question! There's no single \"best\" coffee because taste is subjective. What one person finds delicious, another might find bitter or bland. \n", + "> \n", + "> However, I can give you some pointers to help you find YOUR best coffee:\n", + "> \n", + "> **Factors that influence coffee taste:**\n", + "> \n", + "> * **Bean Origin:** Different regions produce beans with unique flavor profiles. \n", + "> * **Latin America:** Often known for chocolatey, nutty, and smooth flavors. (Colombia, Brazil, Guatemala)\n", + "> * **Africa:** Can have bright acidity, fruity notes, and floral aromas. (Ethiopia, Kenya, Tanzania)\n", + "> * **Asia/Pacific:** Often earthy, spicy, and full-bodied. (Indonesia, Vietnam)\n", + "> * **Roast Level:**\n", + "> * **Light:** More acidic, delicate flavors, higher caffeine.\n", + "> * **Medium:** Balanced acidity and body, versatile.\n", + "> * **Dark:** Bold, smoky, bittersweet flavors, lower caffeine.\n", + "> * **Brewing Method:** Each method extracts flavors differently, impacting the final taste.\n", + "> \n", + "> **Finding YOUR Best:**\n", + "> \n", + "> 1. **Explore Different Origins:** Try coffees from various regions to discover what flavor profiles you enjoy.\n", + "> 2. **Experiment with Roast Levels:** Sample light, medium, and dark roasts to see your preference.\n", + "> 3. **Consider Your Brewing Method:** Different beans work better with certain brewing methods. Ask your local coffee shop for recommendations.\n", + "> 4. **Read Reviews:** Online reviews and coffee blogs can offer insights into specific beans and roasters.\n", + "> 5. **Visit a Local Coffee Shop:** Talk to baristas, ask for recommendations, and try different coffees.\n", + "> \n", + "> **Remember:** Coffee is a journey of discovery! Enjoy the process of exploring and finding your perfect cup.\n" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "result = chat.send_message(\"what is the best coffee?\")\n", + "to_markdown(result)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000 + }, + "id": "tfvgl4sC9g2p", + "outputId": "89326571-90d4-4fc5-db2f-0295831f2581" + }, + "outputs": [ + { + "data": { + "text/markdown": [ + "> \n", + "> \n", + "> user\n", + "> help me understand how to make coffee\n", + "> \n", + "> model\n", + "> \n", + "> \n", + "> user\n", + "> help me understand how to make coffee\n", + "> \n", + "> \n", + "> ## Let's Brew Some Coffee! ☕️\n", + "> \n", + "> Making coffee is a simple process, but there are many ways to do it. Here's a breakdown of some popular methods:\n", + "> \n", + "> **1. Drip Coffee Maker:**\n", + "> \n", + "> * **What you need:** Drip coffee maker, coffee filter, ground coffee, water.\n", + "> * **How to do it:**\n", + "> 1. Fill the water reservoir with fresh, cold water.\n", + "> 2. Place a filter in the filter basket.\n", + "> 3. Add ground coffee to the filter (follow the coffee maker's instructions for the right amount).\n", + "> 4. Turn on the coffee maker and let it brew.\n", + "> 5. Enjoy your freshly brewed coffee!\n", + "> \n", + "> **2. French Press:**\n", + "> \n", + "> * **What you need:** French press, coarse ground coffee, hot water.\n", + "> * **How to do it:**\n", + "> 1. Heat water to just off the boil (around 200°F).\n", + "> 2. Add coarse ground coffee to the French press.\n", + "> 3. Pour hot water over the coffee grounds, making sure all grounds are saturated.\n", + "> 4. Stir gently and place the lid on the press, but don't plunge yet.\n", + "> 5. Let the coffee steep for 4 minutes.\n", + "> 6. Slowly press the plunger down to separate the grounds from the brewed coffee.\n", + "> 7. Pour and enjoy!\n", + "> \n", + "> **3. Pour Over:**\n", + "> \n", + "> * **What you need:** Pour over cone, filter, medium-fine ground coffee, hot water.\n", + "> * **How to do it:**\n", + "> 1. Place a filter in the cone and rinse it with hot water to remove any paper taste.\n", + "> 2. Add medium-fine ground coffee to the filter.\n", + "> 3. Slowly pour hot water over the coffee grounds in a circular motion, making sure all grounds are saturated.\n", + "> 4. Let the coffee drip through into your cup.\n", + "> 5. Enjoy!\n", + "> \n", + "> **4. Cold Brew:**\n", + "> \n", + "> * **What you need:** Coarse ground coffee, cold water, container.\n", + "> * **How to do it:**\n", + "> 1. Combine coarse ground coffee and cold water in a container (ratio of 1:8 coffee to water).\n", + "> 2. Stir well and cover the container.\n", + "> 3. Let the coffee steep in the refrigerator for 12-24 hours.\n", + "> 4. Strain the coffee through a fine-mesh sieve or cheesecloth.\n", + "> 5. Serve over ice and enjoy!\n", + "> \n", + "> **Tips for Better Coffee:**\n", + "> \n", + "> * **Use fresh, high-quality beans:** The better the beans, the better the coffee.\n", + "> * **Grind your beans right before brewing:** This preserves the flavor and aroma.\n", + "> * **Use filtered water:** Impurities in water can affect the taste of your coffee.\n", + "> * **Experiment with different brewing methods:** Find the method that you enjoy the most.\n", + "> * **Clean your coffee maker regularly:** This will help to prevent buildup and ensure that your coffee tastes its best.\n", + "> \n", + "> \n", + "> \n", + "> Let me know if you have any other questions or want to explore a specific brewing method in more detail!\n", + "> \n", + "> \n", + "> user\n", + "> what is the best coffee?\n", + "> \n", + "> model\n", + "> \n", + "> \n", + "> user\n", + "> help me understand how to make coffee\n", + "> \n", + "> model\n", + "> \n", + "> \n", + "> user\n", + "> help me understand how to make coffee\n", + "> \n", + "> \n", + "> ## Let's Brew Some Coffee! ☕️\n", + "> \n", + "> Making coffee is a simple process, but there are many ways to do it. Here's a breakdown of some popular methods:\n", + "> \n", + "> **1. Drip Coffee Maker:**\n", + "> \n", + "> * **What you need:** Drip coffee maker, coffee filter, ground coffee, water.\n", + "> * **How to do it:**\n", + "> 1. Fill the water reservoir with fresh, cold water.\n", + "> 2. Place a filter in the filter basket.\n", + "> 3. Add ground coffee to the filter (follow the coffee maker's instructions for the right amount).\n", + "> 4. Turn on the coffee maker and let it brew.\n", + "> 5. Enjoy your freshly brewed coffee!\n", + "> \n", + "> **2. French Press:**\n", + "> \n", + "> * **What you need:** French press, coarse ground coffee, hot water.\n", + "> * **How to do it:**\n", + "> 1. Heat water to just off the boil (around 200°F).\n", + "> 2. Add coarse ground coffee to the French press.\n", + "> 3. Pour hot water over the coffee grounds, making sure all grounds are saturated.\n", + "> 4. Stir gently and place the lid on the press, but don't plunge yet.\n", + "> 5. Let the coffee steep for 4 minutes.\n", + "> 6. Slowly press the plunger down to separate the grounds from the brewed coffee.\n", + "> 7. Pour and enjoy!\n", + "> \n", + "> **3. Pour Over:**\n", + "> \n", + "> * **What you need:** Pour over cone, filter, medium-fine ground coffee, hot water.\n", + "> * **How to do it:**\n", + "> 1. Place a filter in the cone and rinse it with hot water to remove any paper taste.\n", + "> 2. Add medium-fine ground coffee to the filter.\n", + "> 3. Slowly pour hot water over the coffee grounds in a circular motion, making sure all grounds are saturated.\n", + "> 4. Let the coffee drip through into your cup.\n", + "> 5. Enjoy!\n", + "> \n", + "> **4. Cold Brew:**\n", + "> \n", + "> * **What you need:** Coarse ground coffee, cold water, container.\n", + "> * **How to do it:**\n", + "> 1. Combine coarse ground coffee and cold water in a container (ratio of 1:8 coffee to water).\n", + "> 2. Stir well and cover the container.\n", + "> 3. Let the coffee steep in the refrigerator for 12-24 hours.\n", + "> 4. Strain the coffee through a fine-mesh sieve or cheesecloth.\n", + "> 5. Serve over ice and enjoy!\n", + "> \n", + "> **Tips for Better Coffee:**\n", + "> \n", + "> * **Use fresh, high-quality beans:** The better the beans, the better the coffee.\n", + "> * **Grind your beans right before brewing:** This preserves the flavor and aroma.\n", + "> * **Use filtered water:** Impurities in water can affect the taste of your coffee.\n", + "> * **Experiment with different brewing methods:** Find the method that you enjoy the most.\n", + "> * **Clean your coffee maker regularly:** This will help to prevent buildup and ensure that your coffee tastes its best.\n", + "> \n", + "> \n", + "> \n", + "> Let me know if you have any other questions or want to explore a specific brewing method in more detail!\n", + "> \n", + "> \n", + "> user\n", + "> what is the best coffee?\n", + "> \n", + "> \n", + "> Ah, the eternal question! There's no single \"best\" coffee because taste is subjective. What one person finds delicious, another might find bitter or bland. \n", + "> \n", + "> However, I can give you some pointers to help you find YOUR best coffee:\n", + "> \n", + "> **Factors that influence coffee taste:**\n", + "> \n", + "> * **Bean Origin:** Different regions produce beans with unique flavor profiles. \n", + "> * **Latin America:** Often known for chocolatey, nutty, and smooth flavors. (Colombia, Brazil, Guatemala)\n", + "> * **Africa:** Can have bright acidity, fruity notes, and floral aromas. (Ethiopia, Kenya, Tanzania)\n", + "> * **Asia/Pacific:** Often earthy, spicy, and full-bodied. (Indonesia, Vietnam)\n", + "> * **Roast Level:**\n", + "> * **Light:** More acidic, delicate flavors, higher caffeine.\n", + "> * **Medium:** Balanced acidity and body, versatile.\n", + "> * **Dark:** Bold, smoky, bittersweet flavors, lower caffeine.\n", + "> * **Brewing Method:** Each method extracts flavors differently, impacting the final taste.\n", + "> \n", + "> **Finding YOUR Best:**\n", + "> \n", + "> 1. **Explore Different Origins:** Try coffees from various regions to discover what flavor profiles you enjoy.\n", + "> 2. **Experiment with Roast Levels:** Sample light, medium, and dark roasts to see your preference.\n", + "> 3. **Consider Your Brewing Method:** Different beans work better with certain brewing methods. Ask your local coffee shop for recommendations.\n", + "> 4. **Read Reviews:** Online reviews and coffee blogs can offer insights into specific beans and roasters.\n", + "> 5. **Visit a Local Coffee Shop:** Talk to baristas, ask for recommendations, and try different coffees.\n", + "> \n", + "> **Remember:** Coffee is a journey of discovery! Enjoy the process of exploring and finding your perfect cup.\n", + "> \n", + "> \n", + "> user\n", + "> what are similar drinks?\n", + "> \n", + "> \n", + "> Here are some drinks similar to coffee, categorized by what aspect of coffee they resemble:\n", + "> \n", + "> **Similar Caffeine Kick:**\n", + "> \n", + "> * **Tea:** Wide variety of flavors and caffeine levels, from delicate green tea to robust black tea.\n", + "> * **Matcha:** Powdered green tea with a unique earthy flavor and higher caffeine content than regular green tea.\n", + "> * **Yerba Mate:** South American herbal tea with a slightly bitter, grassy flavor and moderate caffeine.\n", + "> * **Energy Drinks:** High caffeine content, often with added sugar and other stimulants.\n", + "> \n", + "> **Similar Flavor Profiles:**\n", + "> \n", + "> * **Chocolate:** Rich, bittersweet flavors can complement coffee's roasted notes.\n", + "> * **Caramel:** Sweet and buttery, caramel adds a creamy dimension similar to coffee's body.\n", + "> * **Vanilla:** A classic pairing with coffee, vanilla adds a warm, comforting sweetness.\n", + "> * **Espresso-Based Drinks:** Lattes, cappuccinos, macchiatos, and mochas all feature espresso as a base, offering variations in milk and flavorings.\n", + "> \n", + "> **Similar Ritual and Experience:**\n", + "> \n", + "> * **Hot Chocolate:** A comforting and warming drink often enjoyed in the morning or evening.\n", + "> * **Herbal Teas:** A relaxing and flavorful alternative to coffee, enjoyed for their health benefits and calming effects.\n", + "> * **Golden Milk:** A turmeric-based drink with" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "result = chat.send_message(\"what are similar drinks?\")\n", + "to_markdown(result)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "P2GjAVybBez3", + "outputId": "2c6d3d1b-fa64-40ab-827b-a40072cbbf8a" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "user\n", + "help me understand how to make coffee\n", + "\n", + "model\n", + "\n", + "\n", + "user\n", + "help me understand how to make coffee\n", + "\n", + "\n", + "## Let's Brew Some Coffee! ☕️\n", + "\n", + "Making coffee is a simple process, but there are many ways to do it. Here's a breakdown of some popular methods:\n", + "\n", + "**1. Drip Coffee Maker:**\n", + "\n", + "* **What you need:** Drip coffee maker, coffee filter, ground coffee, water.\n", + "* **How to do it:**\n", + " 1. Fill the water reservoir with fresh, cold water.\n", + " 2. Place a filter in the filter basket.\n", + " 3. Add ground coffee to the filter (follow the coffee maker's instructions for the right amount).\n", + " 4. Turn on the coffee maker and let it brew.\n", + " 5. Enjoy your freshly brewed coffee!\n", + "\n", + "**2. French Press:**\n", + "\n", + "* **What you need:** French press, coarse ground coffee, hot water.\n", + "* **How to do it:**\n", + " 1. Heat water to just off the boil (around 200°F).\n", + " 2. Add coarse ground coffee to the French press.\n", + " 3. Pour hot water over the coffee grounds, making sure all grounds are saturated.\n", + " 4. Stir gently and place the lid on the press, but don't plunge yet.\n", + " 5. Let the coffee steep for 4 minutes.\n", + " 6. Slowly press the plunger down to separate the grounds from the brewed coffee.\n", + " 7. Pour and enjoy!\n", + "\n", + "**3. Pour Over:**\n", + "\n", + "* **What you need:** Pour over cone, filter, medium-fine ground coffee, hot water.\n", + "* **How to do it:**\n", + " 1. Place a filter in the cone and rinse it with hot water to remove any paper taste.\n", + " 2. Add medium-fine ground coffee to the filter.\n", + " 3. Slowly pour hot water over the coffee grounds in a circular motion, making sure all grounds are saturated.\n", + " 4. Let the coffee drip through into your cup.\n", + " 5. Enjoy!\n", + "\n", + "**4. Cold Brew:**\n", + "\n", + "* **What you need:** Coarse ground coffee, cold water, container.\n", + "* **How to do it:**\n", + " 1. Combine coarse ground coffee and cold water in a container (ratio of 1:8 coffee to water).\n", + " 2. Stir well and cover the container.\n", + " 3. Let the coffee steep in the refrigerator for 12-24 hours.\n", + " 4. Strain the coffee through a fine-mesh sieve or cheesecloth.\n", + " 5. Serve over ice and enjoy!\n", + "\n", + "**Tips for Better Coffee:**\n", + "\n", + "* **Use fresh, high-quality beans:** The better the beans, the better the coffee.\n", + "* **Grind your beans right before brewing:** This preserves the flavor and aroma.\n", + "* **Use filtered water:** Impurities in water can affect the taste of your coffee.\n", + "* **Experiment with different brewing methods:** Find the method that you enjoy the most.\n", + "* **Clean your coffee maker regularly:** This will help to prevent buildup and ensure that your coffee tastes its best.\n", + "\n", + "\n", + "\n", + "Let me know if you have any other questions or want to explore a specific brewing method in more detail!\n", + "\n", + "\n", + "user\n", + "what is the best coffee?\n", + "\n", + "model\n", + "\n", + "\n", + "user\n", + "help me understand how to make coffee\n", + "\n", + "model\n", + "\n", + "\n", + "user\n", + "help me understand how to make coffee\n", + "\n", + "\n", + "## Let's Brew Some Coffee! ☕️\n", + "\n", + "Making coffee is a simple process, but there are many ways to do it. Here's a breakdown of some popular methods:\n", + "\n", + "**1. Drip Coffee Maker:**\n", + "\n", + "* **What you need:** Drip coffee maker, coffee filter, ground coffee, water.\n", + "* **How to do it:**\n", + " 1. Fill the water reservoir with fresh, cold water.\n", + " 2. Place a filter in the filter basket.\n", + " 3. Add ground coffee to the filter (follow the coffee maker's instructions for the right amount).\n", + " 4. Turn on the coffee maker and let it brew.\n", + " 5. Enjoy your freshly brewed coffee!\n", + "\n", + "**2. French Press:**\n", + "\n", + "* **What you need:** French press, coarse ground coffee, hot water.\n", + "* **How to do it:**\n", + " 1. Heat water to just off the boil (around 200°F).\n", + " 2. Add coarse ground coffee to the French press.\n", + " 3. Pour hot water over the coffee grounds, making sure all grounds are saturated.\n", + " 4. Stir gently and place the lid on the press, but don't plunge yet.\n", + " 5. Let the coffee steep for 4 minutes.\n", + " 6. Slowly press the plunger down to separate the grounds from the brewed coffee.\n", + " 7. Pour and enjoy!\n", + "\n", + "**3. Pour Over:**\n", + "\n", + "* **What you need:** Pour over cone, filter, medium-fine ground coffee, hot water.\n", + "* **How to do it:**\n", + " 1. Place a filter in the cone and rinse it with hot water to remove any paper taste.\n", + " 2. Add medium-fine ground coffee to the filter.\n", + " 3. Slowly pour hot water over the coffee grounds in a circular motion, making sure all grounds are saturated.\n", + " 4. Let the coffee drip through into your cup.\n", + " 5. Enjoy!\n", + "\n", + "**4. Cold Brew:**\n", + "\n", + "* **What you need:** Coarse ground coffee, cold water, container.\n", + "* **How to do it:**\n", + " 1. Combine coarse ground coffee and cold water in a container (ratio of 1:8 coffee to water).\n", + " 2. Stir well and cover the container.\n", + " 3. Let the coffee steep in the refrigerator for 12-24 hours.\n", + " 4. Strain the coffee through a fine-mesh sieve or cheesecloth.\n", + " 5. Serve over ice and enjoy!\n", + "\n", + "**Tips for Better Coffee:**\n", + "\n", + "* **Use fresh, high-quality beans:** The better the beans, the better the coffee.\n", + "* **Grind your beans right before brewing:** This preserves the flavor and aroma.\n", + "* **Use filtered water:** Impurities in water can affect the taste of your coffee.\n", + "* **Experiment with different brewing methods:** Find the method that you enjoy the most.\n", + "* **Clean your coffee maker regularly:** This will help to prevent buildup and ensure that your coffee tastes its best.\n", + "\n", + "\n", + "\n", + "Let me know if you have any other questions or want to explore a specific brewing method in more detail!\n", + "\n", + "\n", + "user\n", + "what is the best coffee?\n", + "\n", + "\n", + "Ah, the eternal question! There's no single \"best\" coffee because taste is subjective. What one person finds delicious, another might find bitter or bland. \n", + "\n", + "However, I can give you some pointers to help you find YOUR best coffee:\n", + "\n", + "**Factors that influence coffee taste:**\n", + "\n", + "* **Bean Origin:** Different regions produce beans with unique flavor profiles. \n", + " * **Latin America:** Often known for chocolatey, nutty, and smooth flavors. (Colombia, Brazil, Guatemala)\n", + " * **Africa:** Can have bright acidity, fruity notes, and floral aromas. (Ethiopia, Kenya, Tanzania)\n", + " * **Asia/Pacific:** Often earthy, spicy, and full-bodied. (Indonesia, Vietnam)\n", + "* **Roast Level:**\n", + " * **Light:** More acidic, delicate flavors, higher caffeine.\n", + " * **Medium:** Balanced acidity and body, versatile.\n", + " * **Dark:** Bold, smoky, bittersweet flavors, lower caffeine.\n", + "* **Brewing Method:** Each method extracts flavors differently, impacting the final taste.\n", + "\n", + "**Finding YOUR Best:**\n", + "\n", + "1. **Explore Different Origins:** Try coffees from various regions to discover what flavor profiles you enjoy.\n", + "2. **Experiment with Roast Levels:** Sample light, medium, and dark roasts to see your preference.\n", + "3. **Consider Your Brewing Method:** Different beans work better with certain brewing methods. Ask your local coffee shop for recommendations.\n", + "4. **Read Reviews:** Online reviews and coffee blogs can offer insights into specific beans and roasters.\n", + "5. **Visit a Local Coffee Shop:** Talk to baristas, ask for recommendations, and try different coffees.\n", + "\n", + "**Remember:** Coffee is a journey of discovery! Enjoy the process of exploring and finding your perfect cup.\n", + "\n", + "\n", + "user\n", + "what are similar drinks?\n", + "\n", + "model\n", + "\n", + "\n", + "user\n", + "help me understand how to make coffee\n", + "\n", + "model\n", + "\n", + "\n", + "user\n", + "help me understand how to make coffee\n", + "\n", + "\n", + "## Let's Brew Some Coffee! ☕️\n", + "\n", + "Making coffee is a simple process, but there are many ways to do it. Here's a breakdown of some popular methods:\n", + "\n", + "**1. Drip Coffee Maker:**\n", + "\n", + "* **What you need:** Drip coffee maker, coffee filter, ground coffee, water.\n", + "* **How to do it:**\n", + " 1. Fill the water reservoir with fresh, cold water.\n", + " 2. Place a filter in the filter basket.\n", + " 3. Add ground coffee to the filter (follow the coffee maker's instructions for the right amount).\n", + " 4. Turn on the coffee maker and let it brew.\n", + " 5. Enjoy your freshly brewed coffee!\n", + "\n", + "**2. French Press:**\n", + "\n", + "* **What you need:** French press, coarse ground coffee, hot water.\n", + "* **How to do it:**\n", + " 1. Heat water to just off the boil (around 200°F).\n", + " 2. Add coarse ground coffee to the French press.\n", + " 3. Pour hot water over the coffee grounds, making sure all grounds are saturated.\n", + " 4. Stir gently and place the lid on the press, but don't plunge yet.\n", + " 5. Let the coffee steep for 4 minutes.\n", + " 6. Slowly press the plunger down to separate the grounds from the brewed coffee.\n", + " 7. Pour and enjoy!\n", + "\n", + "**3. Pour Over:**\n", + "\n", + "* **What you need:** Pour over cone, filter, medium-fine ground coffee, hot water.\n", + "* **How to do it:**\n", + " 1. Place a filter in the cone and rinse it with hot water to remove any paper taste.\n", + " 2. Add medium-fine ground coffee to the filter.\n", + " 3. Slowly pour hot water over the coffee grounds in a circular motion, making sure all grounds are saturated.\n", + " 4. Let the coffee drip through into your cup.\n", + " 5. Enjoy!\n", + "\n", + "**4. Cold Brew:**\n", + "\n", + "* **What you need:** Coarse ground coffee, cold water, container.\n", + "* **How to do it:**\n", + " 1. Combine coarse ground coffee and cold water in a container (ratio of 1:8 coffee to water).\n", + " 2. Stir well and cover the container.\n", + " 3. Let the coffee steep in the refrigerator for 12-24 hours.\n", + " 4. Strain the coffee through a fine-mesh sieve or cheesecloth.\n", + " 5. Serve over ice and enjoy!\n", + "\n", + "**Tips for Better Coffee:**\n", + "\n", + "* **Use fresh, high-quality beans:** The better the beans, the better the coffee.\n", + "* **Grind your beans right before brewing:** This preserves the flavor and aroma.\n", + "* **Use filtered water:** Impurities in water can affect the taste of your coffee.\n", + "* **Experiment with different brewing methods:** Find the method that you enjoy the most.\n", + "* **Clean your coffee maker regularly:** This will help to prevent buildup and ensure that your coffee tastes its best.\n", + "\n", + "\n", + "\n", + "Let me know if you have any other questions or want to explore a specific brewing method in more detail!\n", + "\n", + "\n", + "user\n", + "what is the best coffee?\n", + "\n", + "model\n", + "\n", + "\n", + "user\n", + "help me understand how to make coffee\n", + "\n", + "model\n", + "\n", + "\n", + "user\n", + "help me understand how to make coffee\n", + "\n", + "\n", + "## Let's Brew Some Coffee! ☕️\n", + "\n", + "Making coffee is a simple process, but there are many ways to do it. Here's a breakdown of some popular methods:\n", + "\n", + "**1. Drip Coffee Maker:**\n", + "\n", + "* **What you need:** Drip coffee maker, coffee filter, ground coffee, water.\n", + "* **How to do it:**\n", + " 1. Fill the water reservoir with fresh, cold water.\n", + " 2. Place a filter in the filter basket.\n", + " 3. Add ground coffee to the filter (follow the coffee maker's instructions for the right amount).\n", + " 4. Turn on the coffee maker and let it brew.\n", + " 5. Enjoy your freshly brewed coffee!\n", + "\n", + "**2. French Press:**\n", + "\n", + "* **What you need:** French press, coarse ground coffee, hot water.\n", + "* **How to do it:**\n", + " 1. Heat water to just off the boil (around 200°F).\n", + " 2. Add coarse ground coffee to the French press.\n", + " 3. Pour hot water over the coffee grounds, making sure all grounds are saturated.\n", + " 4. Stir gently and place the lid on the press, but don't plunge yet.\n", + " 5. Let the coffee steep for 4 minutes.\n", + " 6. Slowly press the plunger down to separate the grounds from the brewed coffee.\n", + " 7. Pour and enjoy!\n", + "\n", + "**3. Pour Over:**\n", + "\n", + "* **What you need:** Pour over cone, filter, medium-fine ground coffee, hot water.\n", + "* **How to do it:**\n", + " 1. Place a filter in the cone and rinse it with hot water to remove any paper taste.\n", + " 2. Add medium-fine ground coffee to the filter.\n", + " 3. Slowly pour hot water over the coffee grounds in a circular motion, making sure all grounds are saturated.\n", + " 4. Let the coffee drip through into your cup.\n", + " 5. Enjoy!\n", + "\n", + "**4. Cold Brew:**\n", + "\n", + "* **What you need:** Coarse ground coffee, cold water, container.\n", + "* **How to do it:**\n", + " 1. Combine coarse ground coffee and cold water in a container (ratio of 1:8 coffee to water).\n", + " 2. Stir well and cover the container.\n", + " 3. Let the coffee steep in the refrigerator for 12-24 hours.\n", + " 4. Strain the coffee through a fine-mesh sieve or cheesecloth.\n", + " 5. Serve over ice and enjoy!\n", + "\n", + "**Tips for Better Coffee:**\n", + "\n", + "* **Use fresh, high-quality beans:** The better the beans, the better the coffee.\n", + "* **Grind your beans right before brewing:** This preserves the flavor and aroma.\n", + "* **Use filtered water:** Impurities in water can affect the taste of your coffee.\n", + "* **Experiment with different brewing methods:** Find the method that you enjoy the most.\n", + "* **Clean your coffee maker regularly:** This will help to prevent buildup and ensure that your coffee tastes its best.\n", + "\n", + "\n", + "\n", + "Let me know if you have any other questions or want to explore a specific brewing method in more detail!\n", + "\n", + "\n", + "user\n", + "what is the best coffee?\n", + "\n", + "\n", + "Ah, the eternal question! There's no single \"best\" coffee because taste is subjective. What one person finds delicious, another might find bitter or bland. \n", + "\n", + "However, I can give you some pointers to help you find YOUR best coffee:\n", + "\n", + "**Factors that influence coffee taste:**\n", + "\n", + "* **Bean Origin:** Different regions produce beans with unique flavor profiles. \n", + " * **Latin America:** Often known for chocolatey, nutty, and smooth flavors. (Colombia, Brazil, Guatemala)\n", + " * **Africa:** Can have bright acidity, fruity notes, and floral aromas. (Ethiopia, Kenya, Tanzania)\n", + " * **Asia/Pacific:** Often earthy, spicy, and full-bodied. (Indonesia, Vietnam)\n", + "* **Roast Level:**\n", + " * **Light:** More acidic, delicate flavors, higher caffeine.\n", + " * **Medium:** Balanced acidity and body, versatile.\n", + " * **Dark:** Bold, smoky, bittersweet flavors, lower caffeine.\n", + "* **Brewing Method:** Each method extracts flavors differently, impacting the final taste.\n", + "\n", + "**Finding YOUR Best:**\n", + "\n", + "1. **Explore Different Origins:** Try coffees from various regions to discover what flavor profiles you enjoy.\n", + "2. **Experiment with Roast Levels:** Sample light, medium, and dark roasts to see your preference.\n", + "3. **Consider Your Brewing Method:** Different beans work better with certain brewing methods. Ask your local coffee shop for recommendations.\n", + "4. **Read Reviews:** Online reviews and coffee blogs can offer insights into specific beans and roasters.\n", + "5. **Visit a Local Coffee Shop:** Talk to baristas, ask for recommendations, and try different coffees.\n", + "\n", + "**Remember:** Coffee is a journey of discovery! Enjoy the process of exploring and finding your perfect cup.\n", + "\n", + "\n", + "user\n", + "what are similar drinks?\n", + "\n", + "\n", + "Here are some drinks similar to coffee, categorized by what aspect of coffee they resemble:\n", + "\n", + "**Similar Caffeine Kick:**\n", + "\n", + "* **Tea:** Wide variety of flavors and caffeine levels, from delicate green tea to robust black tea.\n", + "* **Matcha:** Powdered green tea with a unique earthy flavor and higher caffeine content than regular green tea.\n", + "* **Yerba Mate:** South American herbal tea with a slightly bitter, grassy flavor and moderate caffeine.\n", + "* **Energy Drinks:** High caffeine content, often with added sugar and other stimulants.\n", + "\n", + "**Similar Flavor Profiles:**\n", + "\n", + "* **Chocolate:** Rich, bittersweet flavors can complement coffee's roasted notes.\n", + "* **Caramel:** Sweet and buttery, caramel adds a creamy dimension similar to coffee's body.\n", + "* **Vanilla:** A classic pairing with coffee, vanilla adds a warm, comforting sweetness.\n", + "* **Espresso-Based Drinks:** Lattes, cappuccinos, macchiatos, and mochas all feature espresso as a base, offering variations in milk and flavorings.\n", + "\n", + "**Similar Ritual and Experience:**\n", + "\n", + "* **Hot Chocolate:** A comforting and warming drink often enjoyed in the morning or evening.\n", + "* **Herbal Teas:** A relaxing and flavorful alternative to coffee, enjoyed for their health benefits and calming effects.\n", + "* **Golden Milk:** A turmeric-based drink with\n", + "\n" + ] + } + ], + "source": [ + "chat.show_history()" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "id": "z5jMVU0Ymwxn" + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "accelerator": "GPU", + "colab": { + "gpuType": "A100", + "machine_shape": "hm", + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "name": "python3" + }, + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +}