Nakhwa commited on
Commit
76e3ff9
1 Parent(s): 6d68f91

Update deteksi_upload.py

Browse files
Files changed (1) hide show
  1. deteksi_upload.py +6 -2
deteksi_upload.py CHANGED
@@ -10,8 +10,12 @@ import os
10
  from datetime import datetime
11
  import pytz
12
 
13
- # Set environment variable for Google Cloud credentials
14
- os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "inbound-source-431806-g7-e49e388ce0be.json"
 
 
 
 
15
  def save_corrections_to_gcs(bucket_name, file_name, correction_data):
16
  client = storage.Client()
17
  bucket = client.bucket("dashboardhoax-bucket")
 
10
  from datetime import datetime
11
  import pytz
12
 
13
+ # Set environment variable for Google Cloud credentials using secrets
14
+ with open("credentials.json", "w") as f:
15
+ f.write(st.secrets["GOOGLE_APPLICATION_CREDENTIALS"])
16
+
17
+ os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "credentials.json"
18
+
19
  def save_corrections_to_gcs(bucket_name, file_name, correction_data):
20
  client = storage.Client()
21
  bucket = client.bucket("dashboardhoax-bucket")