Skip to content

Commit bfb3775

Browse files
vertex-mg-botcopybara-github
authored andcommitted
Fix the region for llama3 hex-llm chat completion
PiperOrigin-RevId: 681511627
1 parent 538432d commit bfb3775

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

notebooks/community/model_garden/model_garden_pytorch_llama3_1_deployment.ipynb

+6-1
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,11 @@
501501
"source": [
502502
"# @title Chat completion\n",
503503
"\n",
504+
"_region = REGION\n",
505+
"REGION = TPU_DEPLOYMENT_REGION\n",
506+
"\n",
504507
"ENDPOINT_RESOURCE_NAME = \"projects/{}/locations/{}/endpoints/{}\".format(\n",
505-
" PROJECT_ID, TPU_DEPLOYMENT_REGION, endpoints[\"hexllm_tpu\"].name\n",
508+
" PROJECT_ID, REGION, endpoints[\"hexllm_tpu\"].name\n",
506509
")\n",
507510
"\n",
508511
"# @title Chat Completions Inference\n",
@@ -564,6 +567,8 @@
564567
")\n",
565568
"print(model_response)\n",
566569
"\n",
570+
"REGION = _region\n",
571+
"\n",
567572
"# @markdown Click \"Show Code\" to see more details."
568573
]
569574
},

notebooks/community/model_garden/model_garden_pytorch_llama3_2_deployment.ipynb

+6-1
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,11 @@
489489
"source": [
490490
"# @title Chat completion\n",
491491
"\n",
492+
"_region = REGION\n",
493+
"REGION = TPU_DEPLOYMENT_REGION\n",
494+
"\n",
492495
"ENDPOINT_RESOURCE_NAME = \"projects/{}/locations/{}/endpoints/{}\".format(\n",
493-
" PROJECT_ID, TPU_DEPLOYMENT_REGION, endpoints[\"hexllm_tpu\"].name\n",
496+
" PROJECT_ID, REGION, endpoints[\"hexllm_tpu\"].name\n",
494497
")\n",
495498
"\n",
496499
"# @title Chat Completions Inference\n",
@@ -552,6 +555,8 @@
552555
")\n",
553556
"print(model_response)\n",
554557
"\n",
558+
"REGION = _region\n",
559+
"\n",
555560
"# @markdown Click \"Show Code\" to see more details."
556561
]
557562
},

0 commit comments

Comments
 (0)