Skip to content

Commit

Permalink
Set NOTEBOOK_NAME environment variable.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 673127867
  • Loading branch information
dstnluong-google authored and copybara-github committed Sep 11, 2024
1 parent f128e42 commit eb30531
Show file tree
Hide file tree
Showing 61 changed files with 83 additions and 10 deletions.
1 change: 1 addition & 0 deletions notebooks/community/model_garden/model_garden_e5.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
" serving_env = {\n",
" \"MODEL_ID\": model_id,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_e5\",\n",
" }\n",
" model = aiplatform.Model.upload(\n",
" display_name=model_name,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,7 @@
"serving_env = {\n",
" \"MODEL_ID\": \"jax-dito\",\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_jax_dito\",\n",
"}\n",
"\n",
"jax_dito_model = aiplatform.Model.upload(\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1321,6 +1321,7 @@
"serving_env = {\n",
" \"MODEL_ID\": \"F-VLM-JAX-\",\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_jax_fvlm\",\n",
"}\n",
"\n",
"jax_fvlm_model = aiplatform.Model.upload(\n",
Expand Down
1 change: 1 addition & 0 deletions notebooks/community/model_garden/model_garden_mammut.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
" serving_env = {\n",
" \"MODEL_ID\": \"mammut\",\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_mammut\",\n",
" }\n",
"\n",
" if task == \"vqa\":\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@
" serving_env = {\n",
" \"model_path\": model_path,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_autogluon\",\n",
" }\n",
" # Since the model_id is a GCS path, use artifact_uri to pass it\n",
" # to the serving docker.\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@
" \"MAX_LENGTH\": max_length,\n",
" \"NUM_RETURN_SEQUENCES\": num_return_sequences,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_biogpt_serve\",\n",
" }\n",
" # If the model_id is a GCS path, use artifact_uri to pass it to serving docker.\n",
" artifact_uri = model_id if model_id.startswith(\"gs://\") else None\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@
" \"TASK\": task,\n",
" \"PRECISION\": precision,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_biomedclip\",\n",
" }\n",
" # If the model_id is a GCS path, use artifact_uri to pass it to serving docker.\n",
" artifact_uri = model_id if model_id.startswith(\"gs://\") else None\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@
" \"MODEL_ID\": model_id,\n",
" \"TASK\": task,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_blip2\",\n",
" }\n",
" # If the model_id is a GCS path, use artifact_uri to pass it to serving docker.\n",
" artifact_uri = model_id if model_id.startswith(\"gs://\") else None\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@
" \"MODEL_ID\": model_id,\n",
" \"TASK\": task,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_blip_image_captioning\",\n",
" }\n",
" # If the model_id is a GCS path, use artifact_uri to pass it to serving docker.\n",
" artifact_uri = model_id if model_id.startswith(\"gs://\") else None\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@
" \"MODEL_ID\": model_id,\n",
" \"TASK\": task,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_clip\",\n",
" }\n",
" # If the model_id is a GCS path, use artifact_uri to pass it to serving docker.\n",
" artifact_uri = model_id if model_id.startswith(\"gs://\") else None\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
" env_vars = {\n",
" \"MODEL_ID\": base_model_id,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_codellama\",\n",
" }\n",
"\n",
" model = aiplatform.Model.upload(\n",
Expand Down Expand Up @@ -237,7 +238,7 @@
"# @markdown Accept the model agreement to access the models:\n",
"# @markdown 1. Open the [Code LLaMA model card](https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/137).\n",
"# @markdown 2. Review and accept the agreement in the pop-up window on the model card page. If you have previously accepted the model agreement, there will not be a pop-up window on the model card page and this step is not needed.\n",
"# @markdown 3. A Cloud Storage bucket (starting with gs://) containing Code LLaMA pretrained and finetuned models will be shared under the “Documentation” section and its “Get started” subsection.\n",
"# @markdown 3. A Cloud Storage bucket (starting with `gs://`) containing Code LLaMA pretrained and finetuned models will be shared under the “Documentation” section and its “Get started” subsection.\n",
"\n",
"# This path will be shared once click the agreement in Code LLaMA model card\n",
"# as described in the `Access pretrained Code LLaMA models` section.\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
"# @markdown Accept the model agreement to access the models:\n",
"# @markdown 1. Open the [Code LLaMA model card](https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/137).\n",
"# @markdown 2. Review and accept the agreement in the pop-up window on the model card page. If you have previously accepted the model agreement, there will not be a pop-up window on the model card page and this step is not needed.\n",
"# @markdown 3. A Cloud Storage bucket (starting with gs://) containing Code LLaMA pretrained and finetuned models will be shared under the “Documentation” section and its “Get started” subsection.\n",
"# @markdown 3. A Cloud Storage bucket (starting with `gs://`) containing Code LLaMA pretrained and finetuned models will be shared under the “Documentation” section and its “Get started” subsection.\n",
"\n",
"# This path will be shared once click the agreement in Code LLaMA model card\n",
"# as described in the `Access pretrained Code LLaMA models` section.\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@
" \"MODEL_ID\": model_id,\n",
" \"TASK\": task,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_controlnet\",\n",
" }\n",
" model = aiplatform.Model.upload(\n",
" display_name=model_name,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@
" \"CONFIG_YAML_FILE\": model_cfg_yaml_file,\n",
" \"TEST_THRESHOLD\": test_threshold,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_detectron2\",\n",
" }\n",
"\n",
" model = aiplatform.Model.upload(\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"source": [
"## Overview\n",
"\n",
"This notebook demonstrates downloading and deploying the pre-trained [Dolly-V2-3b](https://huggingface.co/databricks/dolly-v2-3b), [Dolly-V2-7b](https://huggingface.co/databricks/dolly-v2-7b) & [Dolly-V2-12b](https://huggingface.co/databricks/dolly-v2-12b) model on Vertex AI for online prediction. It also demonstrates the evaluation of popular benchmark datasets through Vertex CustomJobs using [EleutherAIs evaluation harness](https://github.com/EleutherAI/lm-evaluation-harness).\n",
"This notebook demonstrates downloading and deploying the pre-trained [Dolly-V2-3b](https://huggingface.co/databricks/dolly-v2-3b), [Dolly-V2-7b](https://huggingface.co/databricks/dolly-v2-7b) & [Dolly-V2-12b](https://huggingface.co/databricks/dolly-v2-12b) model on Vertex AI for online prediction. It also demonstrates the evaluation of popular benchmark datasets through Vertex CustomJobs using [EleutherAI's evaluation harness](https://github.com/EleutherAI/lm-evaluation-harness).\n",
"\n",
"\n",
"### Objective\n",
Expand Down Expand Up @@ -286,6 +286,7 @@
" env_vars = {\n",
" \"MODEL_ID\": model_id,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_dolly_v2\",\n",
" }\n",
" model = aiplatform.Model.upload(\n",
" display_name=model_name,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@
" \"--dtype=float16\",\n",
" \"--trust-remote-code\",\n",
" ]\n",
" serving_env = {\"MODEL_ID\": model_id, \"DEPLOY_SOURCE\": \"notebook\"}\n",
" serving_env = {\n",
" \"MODEL_ID\": model_id,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_falcon_instruct_deployment\",\n",
" }\n",
"\n",
" model = aiplatform.Model.upload(\n",
" display_name=model_name,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
" \"BASE_MODEL_ID\": base_model_id,\n",
" \"TASK\": task,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_falcon_instruct_finetuning\",\n",
" }\n",
" if finetuned_lora_model_path:\n",
" serving_env[\"FINETUNED_LORA_MODEL_PATH\"] = finetuned_lora_model_path\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@
" \"MODEL_ID\": model_id,\n",
" \"TASK\": task,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_falcon_instruct_peft\",\n",
" }\n",
" if finetuned_lora_model_path:\n",
" serving_env[\"FINETUNED_LORA_MODEL_PATH\"] = finetuned_lora_model_path\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
" serving_env = {\n",
" \"MODEL_ID\": \"tiiuae/falcon-instruct-quantized\",\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_falcon_instruct_quantization\",\n",
" }\n",
" if quantization_method:\n",
" vllm_args.append(f\"--quantization={quantization_method}\")\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
" \"HF_MODEL_ID\": model_id,\n",
" \"HF_TASK\": task,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_fill_mask\",\n",
" }\n",
"\n",
" model = aiplatform.Model.upload(\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@
" \"MODEL_ID\": \"ImageBind-feature-embedding-generation-001\",\n",
" \"TASK\": task,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_imagebind\",\n",
" }\n",
" model = aiplatform.Model.upload(\n",
" display_name=f\"{model_name}-{task}\",\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
" \"MODEL_ID\": model_id,\n",
" \"TASK\": task,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_instructpix2pix\",\n",
" }\n",
"\n",
" model = aiplatform.Model.upload(\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,11 @@
") -> Tuple[aiplatform.Model, aiplatform.Endpoint]:\n",
" \"\"\"Upload a model to Model registry and deploy it to a Vertex Endpoint.\"\"\"\n",
" endpoint = aiplatform.Endpoint.create(display_name=f\"{model_name}-endpoint\")\n",
" serving_env = {\"MODEL_ID\": \"lama\", \"DEPLOY_SOURCE\": \"notebook\"}\n",
" serving_env = {\n",
" \"MODEL_ID\": \"lama\",\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_lama\",\n",
" }\n",
"\n",
" model = aiplatform.Model.upload(\n",
" display_name=model_name,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@
" \"MODEL_ID\": model_id,\n",
" \"TASK\": task,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_layoutml_document_qa\",\n",
" }\n",
" # If the model_id is a GCS path, use artifact_uri to pass it to serving docker.\n",
" artifact_uri = model_id if model_id.startswith(\"gs://\") else None\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@
" env_vars = {\n",
" \"MODEL_ID\": base_model_id,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_llama2_deployment\",\n",
" }\n",
" model = aiplatform.Model.upload(\n",
" display_name=model_name,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@
" \"--disable-log-stats\",\n",
" ]\n",
"\n",
" env_vars = {\"MODEL_ID\": model_id, \"DEPLOY_SOURCE\": \"notebook\"}\n",
" env_vars = {\n",
" \"MODEL_ID\": model_id,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_llama2_peft_finetuning\",\n",
" }\n",
" model = aiplatform.Model.upload(\n",
" display_name=model_name,\n",
" serving_container_image_uri=VLLM_DOCKER_URI,\n",
Expand Down Expand Up @@ -560,7 +564,7 @@
"top_p = 0.9 # @param {type:\"number\"}\n",
"top_k = 1 # @param {type:\"integer\"}\n",
"\n",
"# Overides max_tokens and top_k parameters during inferences.\n",
"# Overrides max_tokens and top_k parameters during inferences.\n",
"# If you encounter the issue like `ServiceUnavailable: 503 Took too long to respond when processing`,\n",
"# you can reduce the max length, such as set max_tokens as 20.\n",
"instances = [\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
" env_vars = {\n",
" \"MODEL_ID\": model_id,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_llama2_peft_hyperparameter_tuning\",\n",
" }\n",
" model = aiplatform.Model.upload(\n",
" display_name=model_name,\n",
Expand Down Expand Up @@ -646,7 +647,7 @@
"top_p = 0.9 # @param {type:\"number\"}\n",
"top_k = 1 # @param {type:\"integer\"}\n",
"\n",
"# Overides max_tokens and top_k parameters during inferences.\n",
"# Overrides max_tokens and top_k parameters during inferences.\n",
"# If you encounter the issue like `ServiceUnavailable: 503 Took too long to respond when processing`,\n",
"# you can reduce the max length, such as set max_tokens as 20.\n",
"instances = [\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@
" env_vars = {\n",
" \"MODEL_ID\": model_id,\n",
" \"DEPLOY_SOURCE\": \"notebook\"\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_llama2_quantization\",\n",
" }\n",
" model = aiplatform.Model.upload(\n",
" display_name=model_name,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@
" \"TS_NUM_WORKERS\": 1,\n",
" \"PRECISION_MODE\": \"4bit\",\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_llava\",\n",
" }\n",
" # If the model_id is a GCS path, use artifact_uri to pass it to serving docker.\n",
" artifact_uri = model_id if model_id.startswith(\"gs://\") else None\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
" serving_env = {\n",
" \"MODEL_ID\": model_id,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_nllb\",\n",
" }\n",
"\n",
" model = aiplatform.Model.upload(\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@
" \"PRECISION\": precision,\n",
" \"TASK\": task,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_open_clip\",\n",
" }\n",
" model = aiplatform.Model.upload(\n",
" display_name=model_name,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@
" \"PRECISION_LOADING_MODE\": precision_loading_mode,\n",
" \"TASK\": task,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_openllama_peft\",\n",
" }\n",
" if finetuned_lora_model_path:\n",
" serving_env[\"FINETUNED_LORA_MODEL_PATH\"] = finetuned_lora_model_path\n",
Expand Down Expand Up @@ -348,6 +349,7 @@
" serving_env = {\n",
" \"MODEL_ID\": \"openlm-research/open_llama\",\n",
" \"DEPLOY_SOURCE\": \"notebook\"\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_openllama_peft\",\n",
" }\n",
" model = aiplatform.Model.upload(\n",
" display_name=model_name,\n",
Expand Down Expand Up @@ -1282,7 +1284,7 @@
"# endpoint_quantized_vllm = aiplatform.Endpoint(aip_endpoint_name)\n",
"\n",
"\n",
"# Overides max_length and top_k parameters during inferences.\n",
"# Overrides max_length and top_k parameters during inferences.\n",
"# If you encounter the issue like `ServiceUnavailable: 503 Took too long to respond when processing`,\n",
"# you can reduce the max length, such as set max_length as 20.\n",
"instances = [\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@
" \"MODEL_ID\": model_id,\n",
" \"TASK\": task,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_owlvit\",\n",
" }\n",
" # If the model_id is a GCS path, use artifact_uri to pass it to serving docker.\n",
" artifact_uri = model_id if model_id.startswith(\"gs://\") else None\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@
" \"FINETUNED_LORA_MODEL_PATH\": finetuned_lora_model_path,\n",
" \"TASK\": task,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_peft\",\n",
" }\n",
" model = aiplatform.Model.upload(\n",
" display_name=model_name,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,11 @@
"outputs": [],
"source": [
"# Upload model.\n",
"serving_env = {\"MODEL_ID\": \"googleai-pic2word\", \"DEPLOY_SOURCE\": \"notebook\"}\n",
"serving_env = {\n",
" \"MODEL_ID\": \"googleai-pic2word\",\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_pic2word\",\n",
"}\n",
"\n",
"model = aiplatform.Model.upload(\n",
" display_name=\"pic2word-model\",\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@
" \"MODEL_ID\": model_id,\n",
" \"TASK\": task,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_sam\",\n",
" }\n",
" model = aiplatform.Model.upload(\n",
" display_name=task,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
" \"MODEL_ID\": model_id,\n",
" \"TASK\": task,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_sd_2_1_deployment\",\n",
" }\n",
"\n",
" if task == \"image-to-image\":\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@
" \"MODEL_ID\": model_id,\n",
" \"TASK\": task,\n",
" \"DEPLOY_SOURCE\": \"notebook\",\n",
" \"NOTEBOOK_NAME\": \"model_garden_pytorch_sd_2_1_finetuning_dreambooth\",\n",
" }\n",
" model = aiplatform.Model.upload(\n",
" display_name=model_name,\n",
Expand Down
Loading

0 comments on commit eb30531

Please sign in to comment.