karthikrathod commited on
Commit
7e12869
1 Parent(s): ee19447

Update Astronomy_BH_hybrid_RAG.py

Browse files
Files changed (1) hide show
  1. 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
- if not (os.path.exists("storage/bm25") and os.path.exists("storag/kg")):
27
- # List of file names to download
28
- file_names = [
29
- "default__vector_store.json",
30
- "docstore.json",
31
- "graph_store.json",
32
- "image__vector_store.json",
33
- "index_store.json"
34
- ]
35
-
36
- # Bucket name
37
- bucket_name = "title_tailors_bucket"
38
-
39
- # Create the destination directory if it doesn't exist
40
- os.makedirs("storage/bm25", exist_ok=True)
41
-
42
- # Loop through the file names and download each one
43
- for file_name in file_names:
44
- source_blob_name = f"storage/bm25/{file_name}"
45
- destination_file_name = f"storage/bm25/{file_name}"
46
- download_blob(bucket_name, source_blob_name, destination_file_name)
47
-
48
- # List of file names to download
49
- file_names = [
50
- "default__vector_store.json",
51
- "docstore.json",
52
- "graph_store.json",
53
- "image__vector_store.json",
54
- "index_store.json"
55
- ]
56
-
57
- # Bucket name
58
- bucket_name = "title_tailors_bucket"
59
-
60
- # Create the destination directory if it doesn't exist
61
- os.makedirs("storage/kg", exist_ok=True)
62
-
63
- # Loop through the file names and download each one
64
- for file_name in file_names:
65
- source_blob_name = f"storage/kg/{file_name}"
66
- destination_file_name = f"storage/kg/{file_name}"
67
- download_blob(bucket_name, source_blob_name, destination_file_name)
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)