proteusr commited on
Commit
0fdd71a
·
verified ·
1 Parent(s): 2566959

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -4,7 +4,8 @@ import chromadb;
4
  import numpy as np;
5
  import gradio as gr;
6
  from dotenv import load_dotenv;
7
- from chromadb.config import Settings
 
8
 
9
 
10
  load_dotenv()
@@ -18,7 +19,13 @@ CHAT_MODEL = "command-r-08-2024"
18
  PERSIST_DIR = "/mnt/data/chromadb_storage"
19
  os.makedirs(PERSIST_DIR, exist_ok=True)
20
 
21
- client = chromadb.Client( Settings( chroma_db_impl="duckdb+parquet", persist_directory=PERSIST_DIR ) );
 
 
 
 
 
 
22
 
23
  collection = client.get_or_create_collection( name="brampton" );
24
 
 
4
  import numpy as np;
5
  import gradio as gr;
6
  from dotenv import load_dotenv;
7
+ from chromadb import PersistentClient
8
+ from chromadb.config import Settings, DEFAULT_TENANT, DEFAULT_DATABASE
9
 
10
 
11
  load_dotenv()
 
19
  PERSIST_DIR = "/mnt/data/chromadb_storage"
20
  os.makedirs(PERSIST_DIR, exist_ok=True)
21
 
22
+ #client = chromadb.Client( Settings( chroma_db_impl="duckdb+parquet", persist_directory=PERSIST_DIR ) );
23
+ client = PersistentClient(
24
+ path=PERSIST_DIR, # where to store DuckDB+Parquet files
25
+ settings=Settings(), # default settings
26
+ tenant=DEFAULT_TENANT, # usually "default_tenant"
27
+ database=DEFAULT_DATABASE # usually "default_database"
28
+ );
29
 
30
  collection = client.get_or_create_collection( name="brampton" );
31