From 37ece7756b3359f9ec8df1d0f6d58e57bf734d3c Mon Sep 17 00:00:00 2001 From: Dustin Luong Date: Wed, 23 Oct 2024 12:02:17 -0700 Subject: [PATCH] Update Mediapipe Image Generation notebook PiperOrigin-RevId: 689053207 --- ...el_garden_mediapipe_image_generation.ipynb | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/notebooks/community/model_garden/model_garden_mediapipe_image_generation.ipynb b/notebooks/community/model_garden/model_garden_mediapipe_image_generation.ipynb index de5027f92..652796bd1 100644 --- a/notebooks/community/model_garden/model_garden_mediapipe_image_generation.ipynb +++ b/notebooks/community/model_garden/model_garden_mediapipe_image_generation.ipynb @@ -4,6 +4,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "ur8xi4C7S06n" }, "outputs": [], @@ -157,6 +158,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "Jvqs-ehKlaYh" }, "outputs": [], @@ -197,6 +199,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "6d87ae73686c" }, "outputs": [], @@ -222,6 +225,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "tTy1gX11kCJY" }, "outputs": [], @@ -250,6 +254,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "MzGDU7TWdts_" }, "outputs": [], @@ -272,6 +277,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "NIq7R4HZCfIc" }, "outputs": [], @@ -292,6 +298,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "PyQmSRbKA8r-" }, "outputs": [], @@ -318,6 +325,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "9wExiMUxFk91" }, "outputs": [], @@ -346,6 +354,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "riG_qUokg0XZ" }, "outputs": [], @@ -356,7 +365,7 @@ "TRAINING_ACCELERATOR_TYPE = \"NVIDIA_TESLA_A100\"\n", "TRAINING_ACCELERATOR_COUNT = 1\n", "\n", - "PREDICTION_CONTAINER_URI = f\"{REGION_PREFIX}-docker.pkg.dev/vertex-ai/vertex-vision-model-garden-dockers/pytorch-peft-serve\"\n", + "PREDICTION_CONTAINER_URI = f\"{REGION_PREFIX}-docker.pkg.dev/vertex-ai/vertex-vision-model-garden-dockers/pytorch-diffusers-serve-opt:20240403_0836_RC00\"\n", "PREDICTION_PORT = 7080\n", "PREDICTION_ACCELERATOR_TYPE = \"NVIDIA_TESLA_V100\"\n", "PREDICTION_MACHINE_TYPE = \"n1-standard-8\"\n", @@ -391,6 +400,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "edfE2BGVtPSi" }, "outputs": [], @@ -435,6 +445,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "IndQ_m6ddUEM" }, "outputs": [], @@ -471,6 +482,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "um_XKbmpTaHx" }, "outputs": [], @@ -514,6 +526,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "bj31hD4W02Ui" }, "outputs": [], @@ -547,6 +560,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "2dSmBAauGEWw" }, "outputs": [], @@ -569,6 +583,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "iwmsxMzDGhOO" }, "outputs": [], @@ -595,6 +610,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "aec22792ee84" }, "outputs": [], @@ -687,6 +703,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "xsrMHpRvMErS" }, "outputs": [], @@ -737,6 +754,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "ONtgDzGncCc3" }, "outputs": [], @@ -766,6 +784,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "NYuQowyZEtxK" }, "outputs": [], @@ -815,16 +834,17 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "OL6wdXf-1rta" }, "outputs": [], "source": [ + "lora_id = os.path.join(MODEL_EXPORT_PATH, f\"checkpoint_{deployed_checkpoint}\")\n", + "\n", "serving_env = {\n", - " \"TASK\": \"text-to-image-lora\",\n", + " \"TASK\": \"text-to-image\",\n", " \"MODEL_ID\": \"runwayml/stable-diffusion-v1-5\",\n", - " \"FINETUNED_LORA_MODEL_PATH\": os.path.join(\n", - " MODEL_EXPORT_PATH, f\"checkpoint_{deployed_checkpoint}\"\n", - " ),\n", + " \"LORA_ID\": lora_id,\n", " \"DEPLOY_SOURCE\": \"notebook\",\n", "}\n", "\n", @@ -832,7 +852,7 @@ " display_name=UPLOAD_MODEL_NAME,\n", " serving_container_image_uri=PREDICTION_CONTAINER_URI,\n", " serving_container_ports=[PREDICTION_PORT],\n", - " serving_container_predict_route=\"/predictions/peft_serving\",\n", + " serving_container_predict_route=\"/predictions/diffusers_serving\",\n", " serving_container_health_route=\"/ping\",\n", " serving_container_environment_variables=serving_env,\n", ")\n", @@ -861,6 +881,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "BLTA7nRcw57D" }, "outputs": [], @@ -895,6 +916,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "wr7wg9JQ_tjM" }, "outputs": [], @@ -932,6 +954,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "Ax6vQVZhp9pR" }, "outputs": [], @@ -956,6 +979,7 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "id": "vdIZsAstJTcA" }, "outputs": [],