Spaces:
Sleeping
Sleeping
januarevan
commited on
Commit
•
5054b14
1
Parent(s):
6c5586b
init
Browse files
main.py
CHANGED
@@ -4,6 +4,7 @@ from fastapi.encoders import jsonable_encoder
|
|
4 |
from fastapi.responses import JSONResponse
|
5 |
from fastapi.middleware.cors import CORSMiddleware
|
6 |
from pydantic import BaseModel
|
|
|
7 |
|
8 |
|
9 |
import os
|
@@ -62,6 +63,8 @@ def create_a_collection(milvus_client, collection_name):
|
|
62 |
schema=schema
|
63 |
)
|
64 |
|
|
|
|
|
65 |
collection = Collection(name=collection_name, milvus_client=milvus_client)
|
66 |
|
67 |
# Create an index for the collection
|
|
|
4 |
from fastapi.responses import JSONResponse
|
5 |
from fastapi.middleware.cors import CORSMiddleware
|
6 |
from pydantic import BaseModel
|
7 |
+
from pymilvus import connections
|
8 |
|
9 |
|
10 |
import os
|
|
|
63 |
schema=schema
|
64 |
)
|
65 |
|
66 |
+
connections.connect(uri="/app/milvus_data/milvus_demo.db")
|
67 |
+
|
68 |
collection = Collection(name=collection_name, milvus_client=milvus_client)
|
69 |
|
70 |
# Create an index for the collection
|