Skip to content

Commit d5be7ff

Browse files
removed changes for model garden
1 parent ffcd59b commit d5be7ff

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

notebooks/community/model_garden/model_garden_tfvision_image_object_detection.ipynb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,19 +202,19 @@
202202
"# Download config files.\n",
203203
"CONFIG_DIR = os.path.join(BUCKET_URI, \"config\")\n",
204204
"! wget https://raw.githubusercontent.com/tensorflow/models/master/official/vision/configs/experiments/retinanet/coco_spinenet49_gpu_multiworker_mirrored.yaml\n",
205-
"! gcloud storage cp coco_spinenet49_gpu_multiworker_mirrored.yaml $CONFIG_DIR/\n",
205+
"! gsutil cp coco_spinenet49_gpu_multiworker_mirrored.yaml $CONFIG_DIR/\n",
206206
"\n",
207207
"! wget https://raw.githubusercontent.com/tensorflow/models/master/official/vision/configs/experiments/retinanet/coco_spinenet96_gpu_multiworker_mirrored.yaml\n",
208-
"! gcloud storage cp coco_spinenet96_gpu_multiworker_mirrored.yaml $CONFIG_DIR/\n",
208+
"! gsutil cp coco_spinenet96_gpu_multiworker_mirrored.yaml $CONFIG_DIR/\n",
209209
"\n",
210210
"! wget https://raw.githubusercontent.com/tensorflow/models/master/official/vision/configs/experiments/retinanet/coco_spinenet143_gpu_multiworker_mirrored.yaml\n",
211-
"! gcloud storage cp coco_spinenet143_gpu_multiworker_mirrored.yaml $CONFIG_DIR/\n",
211+
"! gsutil cp coco_spinenet143_gpu_multiworker_mirrored.yaml $CONFIG_DIR/\n",
212212
"\n",
213213
"! wget https://raw.githubusercontent.com/tensorflow/models/master/official/projects/yolo/configs/experiments/yolov4/detection/scaled_yolov4_1280_gpu.yaml\n",
214-
"! gcloud storage cp scaled_yolov4_1280_gpu.yaml $CONFIG_DIR/\n",
214+
"! gsutil cp scaled_yolov4_1280_gpu.yaml $CONFIG_DIR/\n",
215215
"\n",
216216
"! wget https://raw.githubusercontent.com/tensorflow/models/master/official/projects/yolo/configs/experiments/yolov7/detection/yolov7_gpu.yaml\n",
217-
"! gcloud storage cp yolov7_gpu.yaml $CONFIG_DIR/"
217+
"! gsutil cp yolov7_gpu.yaml $CONFIG_DIR/"
218218
]
219219
},
220220
{
@@ -499,7 +499,7 @@
499499
" checkpoint_path = os.path.relpath(checkpoint_path, checkpoint_name)\n",
500500
" break\n",
501501
"\n",
502-
" ! gcloud storage cp --recursive $checkpoint_name $CHECKPOINT_BUCKET/\n",
502+
" ! gsutil cp -r $checkpoint_name $CHECKPOINT_BUCKET/\n",
503503
" checkpoint_uri = os.path.join(CHECKPOINT_BUCKET, checkpoint_name, checkpoint_path)\n",
504504
" print(\"Checkpoint uploaded to\", checkpoint_uri)\n",
505505
" return checkpoint_uri"
@@ -932,7 +932,9 @@
932932
" serving_container_image_uri=PREDICTION_CONTAINER_URI,\n",
933933
" serving_container_args=SERVING_CONTAINER_ARGS,\n",
934934
" serving_container_environment_variables=serving_env,\n",
935-
" model_garden_source_model_name=(f\"publishers/google/models/{publisher_model_id}\",),\n",
935+
" model_garden_source_model_name=(\n",
936+
" f\"publishers/google/models/{publisher_model_id}\",\n",
937+
" ),\n",
936938
")\n",
937939
"\n",
938940
"model.wait()\n",

notebooks/community/model_garden/model_garden_timesfm_deployment_on_vertex.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@
162162
"if BUCKET_URI is None or BUCKET_URI.strip() == \"\" or BUCKET_URI == \"gs://\":\n",
163163
" BUCKET_URI = f\"gs://{PROJECT_ID}-tmp-{now}-{str(uuid.uuid4())[:4]}\"\n",
164164
" BUCKET_NAME = \"/\".join(BUCKET_URI.split(\"/\")[:3])\n",
165-
" ! gcloud storage buckets create --location={REGION} {BUCKET_URI}\n",
165+
" ! gsutil mb -l {REGION} {BUCKET_URI}\n",
166166
"else:\n",
167167
" assert BUCKET_URI.startswith(\"gs://\"), \"BUCKET_URI must start with `gs://`.\"\n",
168-
" shell_output = ! gcloud storage ls --full --buckets {BUCKET_NAME} | grep \"Location Constraint:\" | sed \"s/Location Constraint://\"\n",
168+
" shell_output = ! gsutil ls -Lb {BUCKET_NAME} | grep \"Location constraint:\" | sed \"s/Location constraint://\"\n",
169169
" bucket_region = shell_output[0].strip().lower()\n",
170170
" if bucket_region != REGION:\n",
171171
" raise ValueError(\n",
@@ -190,7 +190,7 @@
190190
"\n",
191191
"\n",
192192
"# Provision permissions to the SERVICE_ACCOUNT with the GCS bucket\n",
193-
"! gcloud storage buckets add-iam-policy-binding $BUCKET_NAME --member=serviceAccount:{SERVICE_ACCOUNT} --role=roles/storage.admin\n",
193+
"! gsutil iam ch serviceAccount:{SERVICE_ACCOUNT}:roles/storage.admin $BUCKET_NAME\n",
194194
"\n",
195195
"! gcloud config set project $PROJECT_ID\n",
196196
"! gcloud projects add-iam-policy-binding --no-user-output-enabled {PROJECT_ID} --member=serviceAccount:{SERVICE_ACCOUNT} --role=\"roles/storage.admin\"\n",
@@ -213,7 +213,7 @@
213213
" MODEL_BUCKET,\n",
214214
")\n",
215215
"\n",
216-
"! gcloud storage cp --recursive $VERTEX_AI_MODEL_GARDEN_TIMESFM/$MODEL_VARIANT $MODEL_BUCKET\n",
216+
"! gsutil -m cp -r -R $VERTEX_AI_MODEL_GARDEN_TIMESFM/$MODEL_VARIANT $MODEL_BUCKET\n",
217217
"\n",
218218
"model_path_prefix = MODEL_BUCKET"
219219
]
@@ -908,7 +908,7 @@
908908
"\n",
909909
"delete_bucket = False # @param {type:\"boolean\"}\n",
910910
"if delete_bucket:\n",
911-
" ! gcloud storage rm --recursive $BUCKET_NAME"
911+
" ! gsutil -m rm -r $BUCKET_NAME"
912912
]
913913
},
914914
{

0 commit comments

Comments
 (0)