Spaces:
Runtime error
Runtime error
MEOW commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,14 +38,14 @@ def initialize_settings():
|
|
| 38 |
|
| 39 |
# Create index from documents
|
| 40 |
def create_index(documents):
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
vector_store = MilvusVectorStore(uri="./milvus_demo.db", dim=1024, overwrite=True) #For CPU only vector store
|
| 50 |
storage_context = StorageContext.from_defaults(vector_store=vector_store)
|
| 51 |
return VectorStoreIndex.from_documents(documents, storage_context=storage_context)
|
|
|
|
| 38 |
|
| 39 |
# Create index from documents
|
| 40 |
def create_index(documents):
|
| 41 |
+
vector_store = MilvusVectorStore(
|
| 42 |
+
host="127.0.0.1",
|
| 43 |
+
port=19530,
|
| 44 |
+
dim=1024,
|
| 45 |
+
collection_name="vectorstore",
|
| 46 |
+
gpu_id=0 # Specify the GPU ID to use
|
| 47 |
+
output_fields=["field1","field2"]
|
| 48 |
+
)
|
| 49 |
vector_store = MilvusVectorStore(uri="./milvus_demo.db", dim=1024, overwrite=True) #For CPU only vector store
|
| 50 |
storage_context = StorageContext.from_defaults(vector_store=vector_store)
|
| 51 |
return VectorStoreIndex.from_documents(documents, storage_context=storage_context)
|