Spaces:
Runtime error
Runtime error
MEOW commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -60,15 +60,15 @@ def initialize_settings():
|
|
| 60 |
|
| 61 |
# Create index from documents
|
| 62 |
def create_index(documents):
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
vector_store = MilvusVectorStore(uri="./milvus_demo.db", dim=1024, overwrite=True) #For CPU only vector store
|
| 72 |
storage_context = StorageContext.from_defaults(vector_store=vector_store)
|
| 73 |
return VectorStoreIndex.from_documents(documents, storage_context=storage_context)
|
| 74 |
|
|
|
|
| 60 |
|
| 61 |
# Create index from documents
|
| 62 |
def create_index(documents):
|
| 63 |
+
vector_store = MilvusVectorStore(
|
| 64 |
+
host="127.0.0.1",
|
| 65 |
+
port=19530,
|
| 66 |
+
dim=1024,
|
| 67 |
+
collection_name="vectorstore",
|
| 68 |
+
gpu_id=0, # Specify the GPU ID to use
|
| 69 |
+
output_fields=["field1","field2"]
|
| 70 |
+
)
|
| 71 |
+
# vector_store = MilvusVectorStore(uri="./milvus_demo.db", dim=1024, overwrite=True) #For CPU only vector store
|
| 72 |
storage_context = StorageContext.from_defaults(vector_store=vector_store)
|
| 73 |
return VectorStoreIndex.from_documents(documents, storage_context=storage_context)
|
| 74 |
|