text-to-speech / db /db_connect.py
Daryl Fung
added imgur bucket
932db78
raw
history blame
No virus
480 Bytes
import os
from pymilvus import connections
def connect():
# Initialize a MilvusClient instance
# Replace uri and API key with your own
connections.connect(
alias=os.getenv('MILVUS_DEFAULT'),
uri=os.getenv("MILVUS_CLUSTER_ENDPOINT"), # Cluster endpoint obtained from the console
token=os.getenv("MILVUS_TOKEN") # API key or a colon-separated cluster username and password
)
def disconnect():
connections.disconnect("MILVUS_DEFAULT")