Skip to content
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

Update AI platform API version #12

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions LAB002-0-PDF/3-VectorstoreIndexCreator.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@

index_name = "state_of_union"

PDF_FILE = f"../dataset/unstructured/{index_name}.txt"
loader = TextLoader(f"../dataset/unstructured/{index_name}.txt")
TXT_FILE = f"../dataset/unstructured/{index_name}.txt"
loader = TextLoader(TXT_FILE)
documents = loader.load()


Expand Down
50 changes: 35 additions & 15 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,52 @@ This is part of the JAPAC Generative AI Technical Workshop qwiklabs. The worksho
* Google Generative AI Language offerings
* Langchain integration

## Environment Setup
## Provision Cloud Resources

1. Configure Google Cloud Environment

If you are running the lab in Qwiklabs environment, you do not have to manually configure the Google Project.
If you are running the lab in Qwiklabs environment, you can skip step 2.

To manually configure the Google Cloud project:

2. Use Terraform to create and configure required resources.

```shell
cd terraform/qwiklabs
- Goto `terraform/qwiklabs` folder.

terraform init
terraform plan
terraform apply
```
```shell
cd terraform/qwiklabs
```

- create `terraform.tfvars` file with the following content

```ini
gcp_project_id = <YOUR GCP PROJECT ID>
gcp_region = <DEFAULT GCP PROJECT ID>
gcp_zone = <DEFAULT GCP PROJECT ID>
```

- Apply terraform to privision Google Cloud Resources.

```shell
terraform init
terraform plan -var-file=terraform.tfvars
terraform apply -var-file=terraform.tfvars
```

This will create the following resources:
1. A VPC with firewall rules which allows 80, 8080, 23 TCP inbound traffics.
2. Service Network peering with the VPC.

At this point, you have provisioned required cloud resources.

## Create Vertex AI Workbench as the lab environment.

In this lab, we use Vertex AI Workbench as the lab environment.

1. Follow the [instruction](https://cloud.google.com/vertex-ai/docs/workbench/instances/create-console-quickstart) to provision Vertex AI Workbench Instance.

This will create the following resources:
1. A VPC with firewall rules which allows 80, 8080, 23 TCP inbound traffics.
2. Service Network peering with the VPC.
3. A GCE VM that runs in the VPC created previously.
2. Once the Workbench instance is created. Open the notebook and

3. ssh to the newly created GVE VM instance and clone the repository.
4. Switch to llm-workshop folder and open `1-setup-vm.sh`
5. Update the following line, replace the project id with your own project id.
```shell
export GOOGLE_PROJECT_ID=<YOUR PROJECT ID>
```
Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tabulate
db-dtypes

# Workshop Lab022
google-cloud-aiplatform==1.26.0
google-cloud-aiplatform==1.28.1
shapely<2.0.
protobuf
tensorflow_hub
Expand Down
78 changes: 0 additions & 78 deletions terraform/qwiklab/gce.tf

This file was deleted.

3 changes: 2 additions & 1 deletion terraform/qwiklab/project.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ resource "google_project_service" "google-cloud-apis" {
"servicenetworking.googleapis.com",
"compute.googleapis.com",
"bigquery.googleapis.com",
"run.googleapis.com"
"run.googleapis.com",
"notebooks.googleapis.com"
])
disable_dependent_services = true
disable_on_destroy = true
Expand Down
Loading