This folder contains instructions on how to get set up with Generative AI on Google Cloud.
Please follow the instructions directly in the notebook (.ipynb) files, and note that you will need to run the following cell to authenticates your Colab environment with your Google Cloud account.
from google.colab import auth
auth.authenticate_user()
Vertex AI Workbench is the managed notebook environment on Google Cloud, which enables you to create and customize notebook instances. You do not need extra authentication steps.
To create an instance, follow the instructions here to Create a user-managed notebooks instance. Unless specified in the notebook, you can use default settings when creating your notebook instance.
After launching the notebook instance, you can clone this repository in your JupyterLab environment. To do so, open a Terminal in JupyterLab. Then run the command below to clone the repository into your instance:
git clone https://github.com/GoogleCloudPlatform/generative-ai.git
Install the latest Python SDK:
!pip install google-cloud-aiplatform --upgrade
You will need to initialize vertexai
with your project_id
and location
:
PROJECT_ID = "your-project-id"
LOCATION = "" #e.g. us-central1
import vertexai
vertexai.init(project=PROJECT_ID, location=LOCATION)