|
186 | 186 | "if BUCKET_URI is None or BUCKET_URI.strip() == \"\" or BUCKET_URI == \"gs://\":\n", |
187 | 187 | " BUCKET_URI = f\"gs://{PROJECT_ID}-tmp-{now}-{str(uuid.uuid4())[:4]}\"\n", |
188 | 188 | " 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", |
190 | 190 | "else:\n", |
191 | 191 | " 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", |
193 | 193 | " bucket_region = shell_output[0].strip().lower()\n", |
194 | 194 | " if bucket_region != REGION:\n", |
195 | 195 | " raise ValueError(\n", |
|
214 | 214 | "\n", |
215 | 215 | "\n", |
216 | 216 | "# 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", |
218 | 218 | "\n", |
219 | 219 | "! gcloud config set project $PROJECT_ID\n", |
220 | 220 | "! gcloud projects add-iam-policy-binding --no-user-output-enabled {PROJECT_ID} --member=serviceAccount:{SERVICE_ACCOUNT} --role=\"roles/storage.admin\"\n", |
|
377 | 377 | "if dataset_validation_util.is_gcs_path(pretrained_model_id):\n", |
378 | 378 | " # Download tokenizer.\n", |
379 | 379 | " ! 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", |
382 | 382 | " tokenizer_path = \"./tokenizer\"\n", |
383 | 383 | " access_token = \"\"\n", |
384 | 384 | "else:\n", |
|
431 | 431 | "# @markdown 1. We recommend setting `finetuning_precision_mode` to `4bit` because it enables using fewer hardware resources for finetuning.\n", |
432 | 432 | "# @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", |
433 | 433 | "\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", |
435 | 435 | "training_accelerator_type = (\n", |
436 | 436 | " \"NVIDIA_A100_80GB\" # @param [\"NVIDIA_A100_80GB\", \"NVIDIA_H100_80GB\"]\n", |
437 | 437 | ")\n", |
|
948 | 948 | "\n", |
949 | 949 | "delete_bucket = False # @param {type:\"boolean\"}\n", |
950 | 950 | "if delete_bucket:\n", |
951 | | - " ! gcloud storage rm --recursive $BUCKET_NAME" |
| 951 | + " ! gsutil -m rm -r $BUCKET_NAME" |
952 | 952 | ] |
953 | 953 | } |
954 | 954 | ], |
|
0 commit comments