Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -345,9 +345,8 @@ def save_to_google_storage(bucket_name, file_path, destination_blob_name, expira
|
|
345 |
|
346 |
# Step 3: Use `service_account.Credentials.from_service_account_info` to authenticate directly with the JSON
|
347 |
credentials = service_account.Credentials.from_service_account_info(credentials_dict)
|
|
|
348 |
|
349 |
-
gcs_client = storage.Client() # Initialize Google Cloud Storage client
|
350 |
-
|
351 |
# Check if the bucket exists; if not, create it
|
352 |
try:
|
353 |
bucket = gcs_client.get_bucket(bucket_name)
|
|
|
345 |
|
346 |
# Step 3: Use `service_account.Credentials.from_service_account_info` to authenticate directly with the JSON
|
347 |
credentials = service_account.Credentials.from_service_account_info(credentials_dict)
|
348 |
+
gcs_client = storage.Client(credentials=credentials, project=credentials.project_id)
|
349 |
|
|
|
|
|
350 |
# Check if the bucket exists; if not, create it
|
351 |
try:
|
352 |
bucket = gcs_client.get_bucket(bucket_name)
|