Spaces:
Running
Running
Update deteksi_content.py
Browse files- 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 |
-
|
|
|
|
|
|
|
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
|