Skip to content

Commit 00e8881

Browse files
authored
trying to debug key issues
1 parent 67716d5 commit 00e8881

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cloud_storage.py

+14
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
from google.cloud import storage
22
import os.path
33
import os
4+
import json
5+
6+
def fix_json():
7+
with open('keyfile.json') as json_file:
8+
data = json.load(json_file, strict=False)
9+
with open("keyfile.json", "w") as outfile:
10+
json.dump(data, outfile)
11+
412

513
def test_file_exists():
614
print("Key File Exists")
715
print(os.path.isfile("keyfile.json"))
16+
17+
f = open("keyfile.json", "r")
18+
print(f.read())
19+
fix_json()
820

921
def check_if_exists(bucket_name, file_name):
1022
storage_client = storage.Client.from_service_account_json('keyfile.json')
@@ -64,3 +76,5 @@ def pull_indices():
6476
download_blob("symptomizer_indices_bucket-1", "tfidf.index", "models/tfidf.index")
6577
download_blob("symptomizer_indices_bucket-1", "bert.index", "models/bert.index")
6678
download_blob("symptomizer_indices_bucket-1", "ids.joblib", "models/ids.joblib")
79+
else:
80+
print("No PULL_INDS env found. Rebuilding indices")

0 commit comments

Comments
 (0)