Spaces:
Sleeping
Sleeping
Update server.py
Browse files
server.py
CHANGED
|
@@ -66,7 +66,7 @@ for source, rel_path in SOURCES.items():
|
|
| 66 |
if not os.path.exists(full_path):
|
| 67 |
print(f"Advertencia: No se encontr贸 la ruta para {source}")
|
| 68 |
continue
|
| 69 |
-
|
| 70 |
for root, dirs, files in os.walk(full_path):
|
| 71 |
if "storage_nodes" in dirs:
|
| 72 |
try:
|
|
@@ -74,6 +74,7 @@ for source, rel_path in SOURCES.items():
|
|
| 74 |
storage_context = StorageContext.from_defaults(persist_dir=storage_path)
|
| 75 |
index_name = os.path.basename(root)
|
| 76 |
indices[index_name] = load_index_from_storage(storage_context, index_id="vector_index")
|
|
|
|
| 77 |
except Exception as e:
|
| 78 |
print(f"Error cargando 铆ndice {index_name}: {str(e)}")
|
| 79 |
|
|
@@ -108,7 +109,8 @@ def get_available_retrievers() -> dict:
|
|
| 108 |
"description": metadata.get("description", ""),
|
| 109 |
"last_updated": metadata.get("last_updated", "")
|
| 110 |
})
|
| 111 |
-
|
|
|
|
| 112 |
return {
|
| 113 |
"retrievers": available,
|
| 114 |
"sources": list(retrievers_metadata.keys()),
|
|
|
|
| 66 |
if not os.path.exists(full_path):
|
| 67 |
print(f"Advertencia: No se encontr贸 la ruta para {source}")
|
| 68 |
continue
|
| 69 |
+
|
| 70 |
for root, dirs, files in os.walk(full_path):
|
| 71 |
if "storage_nodes" in dirs:
|
| 72 |
try:
|
|
|
|
| 74 |
storage_context = StorageContext.from_defaults(persist_dir=storage_path)
|
| 75 |
index_name = os.path.basename(root)
|
| 76 |
indices[index_name] = load_index_from_storage(storage_context, index_id="vector_index")
|
| 77 |
+
print(f"脥ndice cargado correctamente: {index_name}")
|
| 78 |
except Exception as e:
|
| 79 |
print(f"Error cargando 铆ndice {index_name}: {str(e)}")
|
| 80 |
|
|
|
|
| 109 |
"description": metadata.get("description", ""),
|
| 110 |
"last_updated": metadata.get("last_updated", "")
|
| 111 |
})
|
| 112 |
+
|
| 113 |
+
print(available)
|
| 114 |
return {
|
| 115 |
"retrievers": available,
|
| 116 |
"sources": list(retrievers_metadata.keys()),
|