Spaces:
Sleeping
Sleeping
karthikrathod
commited on
Commit
•
7e12869
1
Parent(s):
ee19447
Update Astronomy_BH_hybrid_RAG.py
Browse files- Astronomy_BH_hybrid_RAG.py +42 -44
Astronomy_BH_hybrid_RAG.py
CHANGED
@@ -23,50 +23,48 @@ def download_blob(bucket_name, source_blob_name, destination_file_name):
|
|
23 |
blob.download_to_filename(destination_file_name)
|
24 |
print(f"Downloaded storage object {source_blob_name} from bucket {bucket_name} to local file {destination_file_name}.")
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
else:
|
69 |
-
print("Files already exist in the storage_file directory.")
|
70 |
|
71 |
|
72 |
HF_TOKEN = os.environ.get("HF_TOKEN", None)
|
|
|
23 |
blob.download_to_filename(destination_file_name)
|
24 |
print(f"Downloaded storage object {source_blob_name} from bucket {bucket_name} to local file {destination_file_name}.")
|
25 |
|
26 |
+
# List of file names to download
|
27 |
+
file_names = [
|
28 |
+
"default__vector_store.json",
|
29 |
+
"docstore.json",
|
30 |
+
"graph_store.json",
|
31 |
+
"image__vector_store.json",
|
32 |
+
"index_store.json"
|
33 |
+
]
|
34 |
+
|
35 |
+
# Bucket name
|
36 |
+
bucket_name = "title_tailors_bucket"
|
37 |
+
|
38 |
+
# Create the destination directory if it doesn't exist
|
39 |
+
os.makedirs("storage/bm25", exist_ok=True)
|
40 |
+
|
41 |
+
# Loop through the file names and download each one
|
42 |
+
for file_name in file_names:
|
43 |
+
source_blob_name = f"storage/bm25/{file_name}"
|
44 |
+
destination_file_name = f"storage/bm25/{file_name}"
|
45 |
+
download_blob(bucket_name, source_blob_name, destination_file_name)
|
46 |
+
|
47 |
+
# List of file names to download
|
48 |
+
file_names = [
|
49 |
+
"default__vector_store.json",
|
50 |
+
"docstore.json",
|
51 |
+
"graph_store.json",
|
52 |
+
"image__vector_store.json",
|
53 |
+
"index_store.json"
|
54 |
+
]
|
55 |
+
|
56 |
+
# Bucket name
|
57 |
+
bucket_name = "title_tailors_bucket"
|
58 |
+
|
59 |
+
# Create the destination directory if it doesn't exist
|
60 |
+
os.makedirs("storage/kg", exist_ok=True)
|
61 |
+
|
62 |
+
# Loop through the file names and download each one
|
63 |
+
for file_name in file_names:
|
64 |
+
source_blob_name = f"storage/kg/{file_name}"
|
65 |
+
destination_file_name = f"storage/kg/{file_name}"
|
66 |
+
download_blob(bucket_name, source_blob_name, destination_file_name)
|
67 |
+
|
|
|
|
|
68 |
|
69 |
|
70 |
HF_TOKEN = os.environ.get("HF_TOKEN", None)
|