Skip to content

Commit d0fbba3

Browse files
Merge pull request #101 from bhandarivijay-png/ai-gsutil-migration-a66ce10b6f2f426db5f82b7dd322aac1
removed changes for model garden PR #4322
2 parents e6d2c19 + 1d6f2a2 commit d0fbba3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

notebooks/community/model_garden/model_garden_pytorch_gemma_peft_finetuning_hf.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@
186186
"if BUCKET_URI is None or BUCKET_URI.strip() == \"\" or BUCKET_URI == \"gs://\":\n",
187187
" BUCKET_URI = f\"gs://{PROJECT_ID}-tmp-{now}-{str(uuid.uuid4())[:4]}\"\n",
188188
" BUCKET_NAME = \"/\".join(BUCKET_URI.split(\"/\")[:3])\n",
189-
" ! gcloud storage buckets create --location={REGION} {BUCKET_URI}\n",
189+
" ! gsutil mb -l {REGION} {BUCKET_URI}\n",
190190
"else:\n",
191191
" assert BUCKET_URI.startswith(\"gs://\"), \"BUCKET_URI must start with `gs://`.\"\n",
192-
" shell_output = ! gcloud storage ls --full --buckets {BUCKET_NAME} | grep \"Location Constraint:\" | sed \"s/Location Constraint://\"\n",
192+
" shell_output = ! gsutil ls -Lb {BUCKET_NAME} | grep \"Location constraint:\" | sed \"s/Location constraint://\"\n",
193193
" bucket_region = shell_output[0].strip().lower()\n",
194194
" if bucket_region != REGION:\n",
195195
" raise ValueError(\n",
@@ -214,7 +214,7 @@
214214
"\n",
215215
"\n",
216216
"# Provision permissions to the SERVICE_ACCOUNT with the GCS bucket\n",
217-
"! gcloud storage buckets add-iam-policy-binding $BUCKET_NAME --member=serviceAccount:{SERVICE_ACCOUNT} --role=roles/storage.admin\n",
217+
"! gsutil iam ch serviceAccount:{SERVICE_ACCOUNT}:roles/storage.admin $BUCKET_NAME\n",
218218
"\n",
219219
"! gcloud config set project $PROJECT_ID\n",
220220
"! gcloud projects add-iam-policy-binding --no-user-output-enabled {PROJECT_ID} --member=serviceAccount:{SERVICE_ACCOUNT} --role=\"roles/storage.admin\"\n",
@@ -377,8 +377,8 @@
377377
"if dataset_validation_util.is_gcs_path(pretrained_model_id):\n",
378378
" # Download tokenizer.\n",
379379
" ! mkdir tokenizer\n",
380-
" ! gcloud storage cp {pretrained_model_id}/tokenizer.json ./tokenizer\n",
381-
" ! gcloud storage cp {pretrained_model_id}/config.json ./tokenizer\n",
380+
" ! gsutil cp {pretrained_model_id}/tokenizer.json ./tokenizer\n",
381+
" ! gsutil cp {pretrained_model_id}/config.json ./tokenizer\n",
382382
" tokenizer_path = \"./tokenizer\"\n",
383383
" access_token = \"\"\n",
384384
"else:\n",
@@ -431,7 +431,7 @@
431431
"# @markdown 1. We recommend setting `finetuning_precision_mode` to `4bit` because it enables using fewer hardware resources for finetuning.\n",
432432
"# @markdown 1. If `max_steps > 0`, it takes precedence over `epochs`. One can set a small `max_steps` value to quickly check the pipeline.\n",
433433
"\n",
434-
"# @markdown Accelerator type to use for training.\n",
434+
"training_accelerator_type = \"NVIDIA_A100_80GB\" # @param [\"NVIDIA_A100_80GB\", \"NVIDIA_H100_80GB\"]\n",
435435
"training_accelerator_type = (\n",
436436
" \"NVIDIA_A100_80GB\" # @param [\"NVIDIA_A100_80GB\", \"NVIDIA_H100_80GB\"]\n",
437437
")\n",
@@ -948,7 +948,7 @@
948948
"\n",
949949
"delete_bucket = False # @param {type:\"boolean\"}\n",
950950
"if delete_bucket:\n",
951-
" ! gcloud storage rm --recursive $BUCKET_NAME"
951+
" ! gsutil -m rm -r $BUCKET_NAME"
952952
]
953953
}
954954
],

0 commit comments

Comments
 (0)