Spaces:
Running
Running
YanBoChen
commited on
Commit
·
fa19f34
1
Parent(s):
d43c684
fix: update chunk loading to use lists instead of dictionaries for emergency and treatment data
Browse files- .gitignore +3 -0
- src/retrieval.py +2 -2
.gitignore
CHANGED
@@ -67,3 +67,6 @@ htmlcov/
|
|
67 |
coverage.xml
|
68 |
*.cover
|
69 |
dataset/
|
|
|
|
|
|
|
|
67 |
coverage.xml
|
68 |
*.cover
|
69 |
dataset/
|
70 |
+
|
71 |
+
# no backup files
|
72 |
+
customization_processing_backup/
|
src/retrieval.py
CHANGED
@@ -76,13 +76,13 @@ class BasicRetrievalSystem:
|
|
76 |
emergency_chunks_path = cloud_loader.get_model_file_path("models/embeddings/emergency_chunks.json")
|
77 |
with open(emergency_chunks_path, 'r', encoding='utf-8') as f:
|
78 |
emergency_data = json.load(f)
|
79 |
-
self.emergency_chunks =
|
80 |
|
81 |
# Load treatment chunks
|
82 |
treatment_chunks_path = cloud_loader.get_model_file_path("models/embeddings/treatment_chunks.json")
|
83 |
with open(treatment_chunks_path, 'r', encoding='utf-8') as f:
|
84 |
treatment_data = json.load(f)
|
85 |
-
self.treatment_chunks =
|
86 |
|
87 |
logger.info(f"Loaded {len(self.emergency_chunks)} emergency and {len(self.treatment_chunks)} treatment chunks")
|
88 |
|
|
|
76 |
emergency_chunks_path = cloud_loader.get_model_file_path("models/embeddings/emergency_chunks.json")
|
77 |
with open(emergency_chunks_path, 'r', encoding='utf-8') as f:
|
78 |
emergency_data = json.load(f)
|
79 |
+
self.emergency_chunks = list(emergency_data or [])
|
80 |
|
81 |
# Load treatment chunks
|
82 |
treatment_chunks_path = cloud_loader.get_model_file_path("models/embeddings/treatment_chunks.json")
|
83 |
with open(treatment_chunks_path, 'r', encoding='utf-8') as f:
|
84 |
treatment_data = json.load(f)
|
85 |
+
self.treatment_chunks = list(treatment_data or [])
|
86 |
|
87 |
logger.info(f"Loaded {len(self.emergency_chunks)} emergency and {len(self.treatment_chunks)} treatment chunks")
|
88 |
|