Skip to content

Gemma chat notebook update: add Gemma 2 model info #478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 24 additions & 51 deletions site/en/gemma/docs/gemma_chat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"cells": [
{
"cell_type": "markdown",
"id": "JLOS92ZAhfFj",
"metadata": {
"id": "JLOS92ZAhfFj"
},
Expand All @@ -17,7 +16,6 @@
},
{
"cell_type": "markdown",
"id": "Tce3stUlHN0L",
"metadata": {
"id": "Tce3stUlHN0L"
},
Expand All @@ -28,7 +26,6 @@
{
"cell_type": "code",
"execution_count": null,
"id": "tuOe1ymfHZPu",
"metadata": {
"cellView": "form",
"id": "tuOe1ymfHZPu"
Expand All @@ -50,7 +47,6 @@
},
{
"cell_type": "markdown",
"id": "4qxv4Sn9b8CE",
"metadata": {
"id": "4qxv4Sn9b8CE"
},
Expand All @@ -73,7 +69,6 @@
},
{
"cell_type": "markdown",
"id": "402c3d8a",
"metadata": {
"id": "402c3d8a"
},
Expand All @@ -83,7 +78,6 @@
},
{
"cell_type": "markdown",
"id": "b686fd95",
"metadata": {
"id": "b686fd95"
},
Expand All @@ -97,7 +91,6 @@
},
{
"cell_type": "markdown",
"id": "29732090",
"metadata": {
"id": "29732090"
},
Expand All @@ -107,7 +100,6 @@
},
{
"cell_type": "markdown",
"id": "QQ6W7NzRe1VM",
"metadata": {
"id": "QQ6W7NzRe1VM"
},
Expand All @@ -126,7 +118,6 @@
},
{
"cell_type": "markdown",
"id": "_gN-IVRC3dQe",
"metadata": {
"id": "_gN-IVRC3dQe"
},
Expand All @@ -139,7 +130,6 @@
{
"cell_type": "code",
"execution_count": null,
"id": "DrBoa_Urw9Vx",
"metadata": {
"id": "DrBoa_Urw9Vx"
},
Expand All @@ -156,7 +146,6 @@
},
{
"cell_type": "markdown",
"id": "z9oy3QUmXtSd",
"metadata": {
"id": "z9oy3QUmXtSd"
},
Expand All @@ -169,9 +158,9 @@
{
"cell_type": "code",
"execution_count": null,
"id": "a973dd7a",
"metadata": {
"id": "a973dd7a"
"id": "a973dd7a",
"outputId": "b8d13141-99b4-4077-e59c-710bdf83e6a8"
},
"outputs": [
{
Expand Down Expand Up @@ -220,7 +209,6 @@
},
{
"cell_type": "markdown",
"id": "Wme8666dUPVR",
"metadata": {
"id": "Wme8666dUPVR"
},
Expand All @@ -233,7 +221,6 @@
{
"cell_type": "code",
"execution_count": null,
"id": "67d12d2d",
"metadata": {
"id": "67d12d2d"
},
Expand All @@ -250,7 +237,6 @@
},
{
"cell_type": "markdown",
"id": "Ajm_SGWTUjVd",
"metadata": {
"id": "Ajm_SGWTUjVd"
},
Expand All @@ -263,7 +249,6 @@
{
"cell_type": "code",
"execution_count": null,
"id": "3lyn9FxPUok8",
"metadata": {
"id": "3lyn9FxPUok8"
},
Expand All @@ -278,7 +263,6 @@
},
{
"cell_type": "markdown",
"id": "39dc9d5b",
"metadata": {
"id": "39dc9d5b"
},
Expand All @@ -293,9 +277,9 @@
{
"cell_type": "code",
"execution_count": null,
"id": "c86dc8fe",
"metadata": {
"id": "c86dc8fe"
"id": "c86dc8fe",
"outputId": "c53952c5-6d34-4d44-9ce7-38aafa802dbd"
},
"outputs": [
{
Expand Down Expand Up @@ -326,18 +310,17 @@
},
{
"cell_type": "markdown",
"id": "tcCv0BSdVFv9",
"metadata": {
"id": "tcCv0BSdVFv9"
},
"source": [
"`from_preset` instantiates the model from a preset architecture and weights. In the code above, the string `\"gemma_1.1_instruct_2b_en\"` specifies the preset architecture: a Gemma instruction-tuned model with 2 billion parameters.\n",
"This model variant is fine-tuned for conversations and to answer questions in a more natural manner.\n"
"The `GemmaCausalLM.from_preset()` function instantiates the model from a preset architecture and weights. In the code above, the string `\"gemma_1.1_instruct_2b_en\"` specifies the preset the Gemma 2B model with 2 billion parameters. Gemma models with [7B, 9B, and 27B parameters](https://ai.google.com/gemma/docs/get_started#models-list) are also available. You can find the code strings for Gemma models in their **Model Variation** listings on [Kaggle](https://www.kaggle.com/models/google/gemma).\n",
"\n",
"Note: To run the larger models in Colab, you need access to the premium GPUs available in paid plans. Alternatively, you can perform inferences using Kaggle notebooks or Google Cloud projects."
]
},
{
"cell_type": "markdown",
"id": "bLNx8AoeVe-a",
"metadata": {
"id": "bLNx8AoeVe-a"
},
Expand All @@ -348,9 +331,9 @@
{
"cell_type": "code",
"execution_count": null,
"id": "3MorieIpVksu",
"metadata": {
"id": "3MorieIpVksu"
"id": "3MorieIpVksu",
"outputId": "d4947722-10a0-4957-e18b-62da9c3dd1ba"
},
"outputs": [
{
Expand Down Expand Up @@ -483,7 +466,6 @@
},
{
"cell_type": "markdown",
"id": "ArZPOzFpVp6S",
"metadata": {
"id": "ArZPOzFpVp6S"
},
Expand All @@ -495,7 +477,6 @@
},
{
"cell_type": "markdown",
"id": "1WpS39TBYql9",
"metadata": {
"id": "1WpS39TBYql9"
},
Expand All @@ -506,7 +487,6 @@
{
"cell_type": "code",
"execution_count": null,
"id": "3-obTC1jZGpZ",
"metadata": {
"id": "3-obTC1jZGpZ"
},
Expand All @@ -529,7 +509,6 @@
},
{
"cell_type": "markdown",
"id": "5ca54e8c",
"metadata": {
"id": "5ca54e8c"
},
Expand All @@ -548,7 +527,6 @@
},
{
"cell_type": "markdown",
"id": "9583dfd1",
"metadata": {
"id": "9583dfd1"
},
Expand All @@ -559,7 +537,6 @@
{
"cell_type": "code",
"execution_count": null,
"id": "e4e9a187",
"metadata": {
"id": "e4e9a187"
},
Expand Down Expand Up @@ -635,7 +612,6 @@
},
{
"cell_type": "markdown",
"id": "9hmJS4h4ZmiP",
"metadata": {
"id": "9hmJS4h4ZmiP"
},
Expand All @@ -648,9 +624,9 @@
{
"cell_type": "code",
"execution_count": null,
"id": "b1913181",
"metadata": {
"id": "b1913181"
"id": "b1913181",
"outputId": "0e2245c8-a251-4f98-fe0f-597622238274"
},
"outputs": [
{
Expand All @@ -673,7 +649,6 @@
},
{
"cell_type": "markdown",
"id": "ODKxUPP2Zuqy",
"metadata": {
"id": "ODKxUPP2Zuqy"
},
Expand All @@ -684,9 +659,9 @@
{
"cell_type": "code",
"execution_count": null,
"id": "7448005b",
"metadata": {
"id": "7448005b"
"id": "7448005b",
"outputId": "9b07fc2e-8345-48f3-f6ba-24fc3be27777"
},
"outputs": [
{
Expand All @@ -709,9 +684,9 @@
{
"cell_type": "code",
"execution_count": null,
"id": "0973ff54",
"metadata": {
"id": "0973ff54"
"id": "0973ff54",
"outputId": "06c0938d-36cc-4363-dda4-8a8a206f1560"
},
"outputs": [
{
Expand All @@ -734,9 +709,9 @@
{
"cell_type": "code",
"execution_count": null,
"id": "a0c51f42",
"metadata": {
"id": "a0c51f42"
"id": "a0c51f42",
"outputId": "5ccfbb43-73bf-484a-ac55-5af501be67a9"
},
"outputs": [
{
Expand All @@ -758,7 +733,6 @@
},
{
"cell_type": "markdown",
"id": "51a33627",
"metadata": {
"id": "51a33627"
},
Expand All @@ -769,9 +743,9 @@
{
"cell_type": "code",
"execution_count": null,
"id": "221c0817",
"metadata": {
"id": "221c0817"
"id": "221c0817",
"outputId": "4988820b-6003-4768-c827-4275b4582631"
},
"outputs": [
{
Expand Down Expand Up @@ -823,7 +797,6 @@
},
{
"cell_type": "markdown",
"id": "1c8ece6c",
"metadata": {
"id": "1c8ece6c"
},
Expand All @@ -834,9 +807,9 @@
{
"cell_type": "code",
"execution_count": null,
"id": "e48f4ca1",
"metadata": {
"id": "e48f4ca1"
"id": "e48f4ca1",
"outputId": "b9937bfd-4411-4c17-e7a9-38affbdb3fc4"
},
"outputs": [
{
Expand Down Expand Up @@ -939,7 +912,6 @@
},
{
"cell_type": "markdown",
"id": "9693c66f",
"metadata": {
"id": "9693c66f"
},
Expand All @@ -961,7 +933,8 @@
"accelerator": "GPU",
"colab": {
"name": "gemma_chat.ipynb",
"toc_visible": true
"toc_visible": true,
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
Expand All @@ -970,4 +943,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
Loading