# I can not save the checkpoints in GCS

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fi-can-not-save-the-checkpoints-in-gcs%2F17006%3E%5C
**Category:** Models\
**Created:** [April 20, 2022, 2:34pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fi-can-not-save-the-checkpoints-in-gcs%2F17006 "2022-04-20T14:34:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jessicalopez](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/jessicalopez/32/26666_2.png) [@jessicalopez](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fjessicalopez)%5C
**Post date:** [April 20, 2022, 2:34pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fi-can-not-save-the-checkpoints-in-gcs%2F17006%2F1 "2022-04-20T14:34:31Z")

</div>

Hello,

I am using Seq2SeqTrainingArguments to finetune my model:

```auto
training_args = Seq2SeqTrainingArguments(output_dir='gs://my_bucket/models/') 

```

It is supposed to save the checkpoints in GCS (Google Cloud Storage). However, it is saving the checkpoints in my local (I am using Google Colab).

I am doing the authentication as it follows:

```auto
from google.colab import auth

auth.authenticate_user()

project_id = "my_project_id"
!gcloud config set project {project_id}

```

In fact, I can see my files if I type:

```auto
!gsutil ls gs://my_bucket/

```

But it I can not save my checkpoints.

Do you have any idea how can I fix it?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Felipehonorato](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/felipehonorato/32/48418_2.png) [@Felipehonorato](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FFelipehonorato)%5C
**Post date:** [April 20, 2022, 5:15pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fi-can-not-save-the-checkpoints-in-gcs%2F17006%2F2 "2022-04-20T17:15:58Z")

</div>

Hi Jessica! I don’t really know how to solve that but I found a workaround.  
You can create a custom callback to run at each epoch end (Therefore you will have all checkpoints) and upload the model checkpoint using this:

> **[Upload objects  |  Cloud Storage  |  Google Cloud](https://cloud.google.com/storage/docs/uploading-objects#storage-upload-object-python)**
>
> Describes options for uploading objects to a Cloud Storage bucket. An object consists of the data you want to store along with any associated metadata. You can upload objects using the supplied code and API samples.

---

<div class="post-metadata">

**Author:** ![Jyotiyadav](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/jyotiyadav/32/26888_2.png) [@Jyotiyadav](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJyotiyadav)%5C
**Post date:** [January 19, 2024, 3:26pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fi-can-not-save-the-checkpoints-in-gcs%2F17006%2F3 "2024-01-19T15:26:50Z")

</div>

Hi @jessicalopez ,

Were you able to find a solution for this? How to save the checkpoints in GCS?
