<jupyter_start><jupyter_text>Clean-up<jupyter_code>import os
import pprint
import pandas as pd
import tensorflow as tf
import time

from google.cloud import bigquery
from google.cloud import exceptions
from google.cloud import aiplatform as vertex_ai
from google.cloud.aiplatform_v1beta1 import types<jupyter_output><empty_output><jupyter_text>Configure GCP settings<jupyter_code>PREFIX = 'jkwst1'

shell_output=!gcloud config list --format 'value(core.project)' 2>/dev/null
PROJECT = shell_output[0]
print("Project ID: ", PROJECT)
REGION = 'us-central1'
STAGING_BUCKET = f'gs://{PREFIX}-bucket'<jupyter_output><empty_output><jupyter_text>Initialize Vertex AI SDK<jupyter_code>vertex_ai.init(
    project=PROJECT,
    location=REGION,
    staging_bucket=STAGING_BUCKET
)<jupyter_output><empty_output><jupyter_text>Undeploy models<jupyter_code>filter = f'display_name="{PREFIX} Chicago taxi endpoint"'

for endpoint in vertex_ai.Endpoint.list(filter=filter):
    endpoint.undeploy_all()
    endpoint.delete()<jupyter_output><empty_output><jupyter_text>Delete models<jupyter_code>filter = f'display_name="{PREFIX} Chicago taxi classifier"'

for model in vertex_ai.Model.list(filter=filter):
    print('Deleting :', model.display_name)
    model.delete()<jupyter_output>Deleting : jkwst1 Chicago taxi classifier
INFO:google.cloud.aiplatform.base:Deleting Model : projects/630263135640/locations/us-central1/models/6526991293548068864
INFO:google.cloud.aiplatform.base:Delete Model  backing LRO: projects/630263135640/locations/us-central1/operations/4292319946878222336
INFO:google.cloud.aiplatform.base:Model deleted. . Resource name: projects/630263135640/locations/us-central1/models/6526991293548068864
{'fraction_non_alphanumeric': 0.10217263652378156, 'fraction_numerical': 0.060481503229594835, 'mean_word_length': 7.783505154639175, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '654613', 'license': 'Apache-2.0', 'n_tokens_mistral': 644, 'n_tokens_neox': 580, 'n_words': 97, 'path': '09-clean-up/01-cleanup.ipynb', 'repo_name': 'jasmeetsb/vertex-ai-workshop', 'size': '1703'}