Skip to content

Commit

Permalink
No-code/low-code notebook: fix sd 1.5 dreambooth model deployment sec…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
xcchen1 committed Apr 22, 2024
1 parent 3dac000 commit 461378f
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -390,8 +390,8 @@
"# @markdown The model deployment step will take ~15 minutes to complete.\n",
"\n",
"# Sets the model_id to gs://{GCS_BUCKET}/dreambooth/output to load the OSS fine-tuned model.\n",
"model_text_to_image, endpoint_text_to_image = deploy_model(\n",
" model_id=f\"gs://{BUCKET_NAME}/dreambooth/output\", task=\"text-to-image\"\n",
"model, endpoint = deploy_model(\n",
" model_id=os.path.join(BUCKET_URI, \"dreambooth/output\"), task=\"text-to-image\"\n",
")"
]
},
Expand All @@ -410,12 +410,12 @@
"\n",
"# @markdown When deployed on one L4 GPU, the average inference time of a request is ~15 seconds.\n",
"\n",
"prompt = \"A serious capybara at work, wearing a suit\" # @param {type: \"string\"}\n",
"prompt = \"a photo of sks dog sitting in a bucket\" # @param {type: \"string\"}\n",
"\n",
"instances = [\n",
" {\"prompt\": prompt},\n",
"]\n",
"response = endpoint_text_to_image.predict(instances=instances)\n",
"response = endpoint.predict(instances=instances)\n",
"images = [base64_to_image(image) for image in response.predictions]\n",
"image_grid(images, rows=1)"
]
Expand Down

0 comments on commit 461378f

Please sign in to comment.