[Gemma 2]Guess The Word
recurrentgemmagemmapaligemmagemma-cookbookcodegemma
Export
Copyright 2024 Google LLC.
[ ]
Play with AI - Guess the word
This cookbook illustrates how you can employ the instruction-tuned model version of Gemma as a chatbot to play "Guess the word" game.
Setup
Select the Colab runtime
To complete this tutorial, you'll need to have a Colab runtime with sufficient resources to run the Gemma model. In this case, you can use a T4 GPU:
- In the upper-right of the Colab window, select ▾ (Additional connection options).
- Select Change runtime type.
- Under Hardware accelerator, select T4 GPU.
Gemma setup on Kaggle
To complete this tutorial, you'll first need to complete the setup instructions at Gemma setup. The Gemma setup instructions show you how to do the following:
- Get access to Gemma on kaggle.com.
- Select a Colab runtime with sufficient resources to run the Gemma 2B model.
- Generate and configure a Kaggle username and API key.
After you've completed the Gemma setup, move on to the next section, where you'll set environment variables for your Colab environment.
Set environment variables
Set environment variables for KAGGLE_USERNAME and KAGGLE_KEY.
[1]
Install dependencies
Install Keras and KerasNLP.
[ ]
Create a chat helper to manage the conversation state
[ ]
Play the game
[4]
Choose your theme: animal Guess what I'm thinking. Type "quit" if you want to quit. A playful, furry swimmer. Known for its playful antics and clever use of tools. A member of the weasel-like family with a distinctive, waterproof coat. <end_of_turn> > platypus A creature that spends its days by a river or lake, often seen splashing and diving with its distinctive, thick fur. It's known for its playful demeanor and ability to hold a surprisingly large amount of water in its paws. <end_of_turn> > beaver A small, aquatic mammal with a playful, curious nature, often spotted near water, known for its distinctive, waterproof fur and love for swimming. <end_of_turn> > otter Correct!
Run in Google Colab