Skip to content

Commit 37a7aa3

Browse files
Merge pull request #87 from gurusai-voleti/br_4319
removed model_garden changes
2 parents 7d21037 + ff7f63c commit 37a7aa3

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

notebooks/community/model_garden/model_garden_pytorch_mistral_peft_tuning.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@
187187
"if BUCKET_URI is None or BUCKET_URI.strip() == \"\" or BUCKET_URI == \"gs://\":\n",
188188
" BUCKET_URI = f\"gs://{PROJECT_ID}-tmp-{now}-{str(uuid.uuid4())[:4]}\"\n",
189189
" BUCKET_NAME = \"/\".join(BUCKET_URI.split(\"/\")[:3])\n",
190-
" ! gcloud storage buckets create --location={REGION} {BUCKET_URI}\n",
190+
" ! gsutil mb -l {REGION} {BUCKET_URI}\n",
191191
"else:\n",
192192
" assert BUCKET_URI.startswith(\"gs://\"), \"BUCKET_URI must start with `gs://`.\"\n",
193-
" shell_output = ! gcloud storage ls --full --buckets {BUCKET_NAME} | grep \"Location Constraint:\" | sed \"s/Location Constraint://\"\n",
193+
" shell_output = ! gsutil ls -Lb {BUCKET_NAME} | grep \"Location constraint:\" | sed \"s/Location constraint://\"\n",
194194
" bucket_region = shell_output[0].strip().lower()\n",
195195
" if bucket_region != REGION:\n",
196196
" raise ValueError(\n",
@@ -215,7 +215,7 @@
215215
"\n",
216216
"\n",
217217
"# Provision permissions to the SERVICE_ACCOUNT with the GCS bucket\n",
218-
"! gcloud storage buckets add-iam-policy-binding $BUCKET_NAME --member=serviceAccount:{SERVICE_ACCOUNT} --role=roles/storage.admin\n",
218+
"! gsutil iam ch serviceAccount:{SERVICE_ACCOUNT}:roles/storage.admin $BUCKET_NAME\n",
219219
"\n",
220220
"! gcloud config set project $PROJECT_ID\n",
221221
"! gcloud projects add-iam-policy-binding --no-user-output-enabled {PROJECT_ID} --member=serviceAccount:{SERVICE_ACCOUNT} --role=\"roles/storage.admin\"\n",
@@ -335,8 +335,8 @@
335335
"if dataset_validation_util.is_gcs_path(pretrained_model_id):\n",
336336
" # Download tokenizer.\n",
337337
" ! mkdir tokenizer\n",
338-
" ! gcloud storage cp {pretrained_model_id}/tokenizer.json ./tokenizer\n",
339-
" ! gcloud storage cp {pretrained_model_id}/config.json ./tokenizer\n",
338+
" ! gsutil cp {pretrained_model_id}/tokenizer.json ./tokenizer\n",
339+
" ! gsutil cp {pretrained_model_id}/config.json ./tokenizer\n",
340340
" tokenizer_path = \"./tokenizer\"\n",
341341
" access_token = \"\"\n",
342342
"else:\n",
@@ -891,7 +891,7 @@
891891
"\n",
892892
"delete_bucket = False # @param {type:\"boolean\"}\n",
893893
"if delete_bucket:\n",
894-
" ! gcloud storage rm --recursive $BUCKET_NAME"
894+
" ! gsutil -m rm -r $BUCKET_NAME"
895895
]
896896
}
897897
],

notebooks/community/model_garden/model_garden_pytorch_mixtral_peft_tuning.ipynb

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@
187187
"if BUCKET_URI is None or BUCKET_URI.strip() == \"\" or BUCKET_URI == \"gs://\":\n",
188188
" BUCKET_URI = f\"gs://{PROJECT_ID}-tmp-{now}-{str(uuid.uuid4())[:4]}\"\n",
189189
" BUCKET_NAME = \"/\".join(BUCKET_URI.split(\"/\")[:3])\n",
190-
" ! gcloud storage buckets create --location {REGION} {BUCKET_URI}\n",
190+
" ! gsutil mb -l {REGION} {BUCKET_URI\n",
191191
"else:\n",
192192
" assert BUCKET_URI.startswith(\"gs://\"), \"BUCKET_URI must start with `gs://`.\"\n",
193-
" shell_output = ! gcloud storage ls --full --buckets {BUCKET_NAME} | grep \"Location Constraint:\" | sed \"s/Location Constraint://\"\n",
193+
" shell_output = ! gsutil ls -Lb {BUCKET_NAME} | grep \"Location constraint:\" | sed \"s/Location constraint://\"\n",
194194
" bucket_region = shell_output[0].strip().lower()\n",
195195
" if bucket_region != REGION:\n",
196196
" raise ValueError(\n",
@@ -215,7 +215,7 @@
215215
"\n",
216216
"\n",
217217
"# Provision permissions to the SERVICE_ACCOUNT with the GCS bucket\n",
218-
"! gcloud storage buckets add-iam-policy-binding $BUCKET_NAME --member=serviceAccount:{SERVICE_ACCOUNT} --role=roles/storage.admin\n",
218+
"! gsutil iam ch serviceAccount:{SERVICE_ACCOUNT}:roles/storage.admin $BUCKET_NAME\n",
219219
"\n",
220220
"! gcloud config set project $PROJECT_ID\n",
221221
"! gcloud projects add-iam-policy-binding --no-user-output-enabled {PROJECT_ID} --member=serviceAccount:{SERVICE_ACCOUNT} --role=\"roles/storage.admin\"\n",
@@ -335,8 +335,8 @@
335335
"if dataset_validation_util.is_gcs_path(pretrained_model_id):\n",
336336
" # Download tokenizer.\n",
337337
" ! mkdir tokenizer\n",
338-
" ! gcloud storage cp {pretrained_model_id}/tokenizer.json ./tokenizer\n",
339-
" ! gcloud storage cp {pretrained_model_id}/config.json ./tokenizer\n",
338+
" ! gsutil cp {pretrained_model_id}/tokenizer.json ./tokenizer\n",
339+
" ! gsutil cp {pretrained_model_id}/config.json ./tokenizer\n",
340340
" tokenizer_path = \"./tokenizer\"\n",
341341
" access_token = \"\"\n",
342342
"else:\n",
@@ -614,9 +614,7 @@
614614
"\n",
615615
"# Find Vertex AI prediction supported accelerators and regions [here](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute).\n",
616616
"# @markdown Accelerator type to use for serving.\n",
617-
"accelerator_type = (\n",
618-
" \"NVIDIA_L4\" # @param [\"NVIDIA_L4\", \"NVIDIA_TESLA_V100\", \"NVIDIA_H100_80GB\"]\n",
619-
")\n",
617+
"accelerator_type = \"NVIDIA_L4\" # @param [\"NVIDIA_L4\", \"NVIDIA_TESLA_V100\", \"NVIDIA_H100_80GB\"]\n",
620618
"\n",
621619
"if accelerator_type == \"NVIDIA_L4\":\n",
622620
" machine_type = \"g2-standard-96\"\n",
@@ -899,7 +897,7 @@
899897
"\n",
900898
"delete_bucket = False # @param {type:\"boolean\"}\n",
901899
"if delete_bucket:\n",
902-
" ! gcloud storage rm --recursive $BUCKET_NAME"
900+
" ! gsutil -m rm -r $BUCKET_NAME"
903901
]
904902
}
905903
],

0 commit comments

Comments
 (0)