openai / lm-human-preferences

Code for the paper Fine-Tuning Language Models from Human Preferences
https://openai.com/blog/fine-tuning-gpt-2/
MIT License
1.24k stars 164 forks source link

Trouble with accessing bucket / Google credentials #7

Closed alberg94 closed 4 years ago

alberg94 commented 4 years ago

I am running this on Google Colab and initially ran into the error following error in the line bucket = client.get_bucket(bucket_name) in gcs.py (bucket_name is gpt-2):

google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application. For more information, please see https://cloud.google.com/docs/authentication/getting-started

Starts at:

File "/content/gdrive/My Drive/Glasgow/MSc Project/code/2496762_cluster_files/lm-human-preferences-master/lm_human_preferences/utils/gcs.py", line 75, in get_blob bucket = client.get_bucket(bucket_name)

After adding my own credentials I get another error at the same place:

google.api_core.exceptions.Forbidden: 403 GET https://www.googleapis.com/storage/v1/b/gpt-2?projection=noAcl: alexanderberg94@cosmic-talent-287614.iam.gserviceaccount.com does not have storage.buckets.get access to the Google Cloud Storage bucket.

Do I have to apply for a permission or are there publicly available credentials that should be used?

Thanks in advance, Alexander

EDIT:

Could this be related to "role" when generating a credential key?

alberg94 commented 4 years ago

I solved this by downloading the json file needed and pointing to it directly. Therefore, skipping all google storage issues.