Spaces:
Paused
Paused
import os | |
SAAS = True | |
def get_db_config(cname="nvdajp-book"): | |
if cname == "nvdajp-book": | |
url = os.environ["QDRANT_URL"] | |
elif cname == "nvdajp-book-e5": | |
url = os.environ["QDRANT_E5_URL"] | |
api_key = os.environ["QDRANT_API_KEY"] | |
collection_name = cname | |
return url, api_key, collection_name | |
def get_local_db_congin(cname="nvdajp-book"): | |
url = "localhost" | |
# api_key = os.environ["QDRANT_API_KEY"] | |
collection_name = cname | |
return url, None, collection_name | |
DB_CONFIG = get_db_config() if SAAS else get_local_db_congin() | |
DB_E5_CONFIG = ( | |
get_db_config("nvdajp-book-e5") if SAAS else get_local_db_congin("nvdajp-book-e5") | |
) | |