Skip to content
Merged
2 changes: 1 addition & 1 deletion .cloud-build/execute_changed_notebooks_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def process_and_execute_notebook(
# Use gcloud to get tail
try:
result.error_message = subprocess.check_output(
["gsutil", "cat", "-r", "-1000", log_file_uri], encoding="UTF-8"
["gcloud", "storage", "cat", "--range", "-1000", log_file_uri], encoding="UTF-8"
)
except Exception as error:
result.error_message = str(error)
Expand Down
8 changes: 4 additions & 4 deletions notebooks/official/generative_ai/distillation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@
},
"outputs": [],
"source": [
"! gsutil mb -l {LOCATION} -p {PROJECT_ID} {BUCKET_URI}"
"! gcloud storage buckets create --location={LOCATION} --project={PROJECT_ID} {BUCKET_URI}"
]
},
{
Expand All @@ -347,8 +347,8 @@
},
"outputs": [],
"source": [
"! gsutil cp gs://cloud-samples-data/vertex-ai/model-evaluation/peft_eval_sample.jsonl {BUCKET_URI}/peft_eval_sample.jsonl\n",
"! gsutil cp gs://cloud-samples-data/vertex-ai/model-evaluation/peft_train_sample.jsonl {BUCKET_URI}/peft_train_sample.jsonl"
"! gcloud storage cp gs://cloud-samples-data/vertex-ai/model-evaluation/peft_eval_sample.jsonl {BUCKET_URI}/peft_eval_sample.jsonl\n",
"! gcloud storage cp gs://cloud-samples-data/vertex-ai/model-evaluation/peft_train_sample.jsonl {BUCKET_URI}/peft_train_sample.jsonl"
]
},
{
Expand Down Expand Up @@ -554,7 +554,7 @@
"# Delete the Cloud Storage bucket\n",
"delete_bucket = True\n",
"if delete_bucket:\n",
" ! gsutil rm -rf {BUCKET_URI}"
" ! gcloud storage rm --recursive --continue-on-error {BUCKET_URI}"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
},
"outputs": [],
"source": [
"! gsutil mb -l {LOCATION} -p {PROJECT_ID} {BUCKET_URI}"
"! gcloud storage buckets create --location={LOCATION} --project={PROJECT_ID} {BUCKET_URI}"
]
},
{
Expand Down Expand Up @@ -390,7 +390,7 @@
"outputs": [],
"source": [
"!wget https://storage.googleapis.com/download.tensorflow.org/data/abalone_train.csv\n",
"!gsutil cp abalone_train.csv {BUCKET_URI}/data/\n",
"!gcloud storage cp abalone_train.csv {BUCKET_URI}/data/\n",
"\n",
"gcs_csv_path = f\"{BUCKET_URI}/data/abalone_train.csv\""
]
Expand Down Expand Up @@ -784,7 +784,7 @@
"\n",
"\n",
"if delete_bucket:\n",
" ! gsutil -m rm -r $BUCKET_URI"
" ! gcloud storage rm --recursive $BUCKET_URI"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
"source": [
"# Create GCS Bucket\n",
"BUCKET_URI = \"gs://your-bucket-name-unique\" # @param {type:\"string\"}\n",
"! gsutil mb -l {LOCATION} -p {PROJECT_ID} {BUCKET_URI}"
"! gcloud storage buckets create --location {LOCATION} --project {PROJECT_ID} {BUCKET_URI}"
]
},
{
Expand Down Expand Up @@ -237,7 +237,7 @@
"outputs": [],
"source": [
"# Copy Models to the Bucket\n",
"! gsutil cp -r \"gs://cloud-samples-data/vertex-ai/prediction/test-models-requests/*\" {BUCKET_URI}"
"! gcloud storage cp --recursive \"gs://cloud-samples-data/vertex-ai/prediction/test-models-requests/*\" {BUCKET_URI}"
]
},
{
Expand Down Expand Up @@ -508,7 +508,7 @@
"outputs": [],
"source": [
"# Download the requests files:\n",
"! gsutil cp {BUCKET_URI}/requests/* ./"
"! gcloud storage cp {BUCKET_URI}/requests/* ./"
]
},
{
Expand Down Expand Up @@ -716,7 +716,7 @@
},
"outputs": [],
"source": [
"! gsutil rm -r {BUCKET_URI}"
"! gcloud storage rm --recursive {BUCKET_URI}"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
},
"outputs": [],
"source": [
"! gsutil mb -l {LOCATION} -p {PROJECT_ID} {BUCKET_URI}"
"! gcloud storage buckets create --location={LOCATION} --project={PROJECT_ID} {BUCKET_URI}"
]
},
{
Expand Down Expand Up @@ -500,7 +500,7 @@
"source": [
"dataset = \"gs://cloud-samples-data/vertex-ai/prediction/llm/test_table.jsonl\"\n",
"destination_uri_prefix = f\"{BUCKET_URI}/text-bison@001_\"\n",
"! gsutil cp -r gs://cloud-samples-data/vertex-ai/prediction/llm/text-bison@001_/ {destination_uri_prefix}\n",
"! gcloud storage cp --recursive gs://cloud-samples-data/vertex-ai/prediction/llm/text-bison@001_/ {destination_uri_prefix}\n",
"\n",
"\n",
"from vertexai.language_models import TextGenerationModel\n",
Expand Down Expand Up @@ -580,7 +580,7 @@
"outputs": [],
"source": [
"# Tuning model\n",
"! gsutil cp gs://cloud-samples-data/vertex-ai/prediction/llm/q_a_train_with_context.jsonl {BUCKET_URI}/q_a_train_with_context.jsonl\n",
"! gcloud storage cp gs://cloud-samples-data/vertex-ai/prediction/llm/q_a_train_with_context.jsonl {BUCKET_URI}/q_a_train_with_context.jsonl\n",
"\n",
"tuning_job = model3.tune_model(\n",
" training_data=f\"{BUCKET_URI}/q_a_train_with_context.jsonl\",\n",
Expand Down Expand Up @@ -740,7 +740,7 @@
"batch_job_2.delete()\n",
"\n",
"if delete_bucket:\n",
" ! gsutil -m rm -r $BUCKET_URI"
" ! gcloud storage rm --recursive $BUCKET_URI"
]
}
],
Expand Down