Nakhwa commited on
Commit
6d68f91
·
verified ·
1 Parent(s): 80b7118

Update deteksi_content.py

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