Spaces:
Sleeping
Sleeping
Update pipeline.py
Browse files- pipeline.py +4 -4
pipeline.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
|
| 2 |
import time
|
| 3 |
from pathlib import Path
|
| 4 |
-
from typing import List, Any
|
| 5 |
import asyncio # Import asyncio for concurrent operations
|
| 6 |
|
| 7 |
from llama_index.core import Document, StorageContext, VectorStoreIndex, Settings
|
|
@@ -40,9 +40,9 @@ class Pipeline:
|
|
| 40 |
# Initialize components
|
| 41 |
self.documents: List[Document] = []
|
| 42 |
self.nodes: List[Any] = []
|
| 43 |
-
self.storage_context: StorageContext
|
| 44 |
-
self.index: VectorStoreIndex
|
| 45 |
-
self.retriever: BaseRetriever
|
| 46 |
self.leaf_nodes: List[Any] = []
|
| 47 |
self.root_nodes: List[Any] = []
|
| 48 |
|
|
|
|
| 1 |
|
| 2 |
import time
|
| 3 |
from pathlib import Path
|
| 4 |
+
from typing import List, Any, Union
|
| 5 |
import asyncio # Import asyncio for concurrent operations
|
| 6 |
|
| 7 |
from llama_index.core import Document, StorageContext, VectorStoreIndex, Settings
|
|
|
|
| 40 |
# Initialize components
|
| 41 |
self.documents: List[Document] = []
|
| 42 |
self.nodes: List[Any] = []
|
| 43 |
+
self.storage_context: Union[StorageContext, None] = None
|
| 44 |
+
self.index: Union[VectorStoreIndex, None] = None
|
| 45 |
+
self.retriever: Union[BaseRetriever, None] = None
|
| 46 |
self.leaf_nodes: List[Any] = []
|
| 47 |
self.root_nodes: List[Any] = []
|
| 48 |
|