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