Pulastya0 commited on
Commit
fc7e88c
·
verified ·
1 Parent(s): 33f278e

Update agent_langchain.py

Browse files
Files changed (1) hide show
  1. agent_langchain.py +6 -5
agent_langchain.py CHANGED
@@ -49,12 +49,13 @@ clf_model = AutoModelForSequenceClassification.from_pretrained(clf_model_name)
49
  # -------------------------------
50
  # Initialize ChromaDB Client for KB
51
  # -------------------------------
52
- chroma_client = chromadb.Client(Settings(
53
- chroma_db_impl="duckdb+parquet",
54
- persist_directory="/data/chroma_db"
55
- ))
56
 
57
- COLLECTION_NAME = "kb_collection"
 
 
 
58
  try:
59
  kb_collection = chroma_client.get_collection(COLLECTION_NAME)
60
  except:
 
49
  # -------------------------------
50
  # Initialize ChromaDB Client for KB
51
  # -------------------------------
52
+ # Use new API — persistent on Hugging Face writable directory
53
+ chroma_client = chromadb.PersistentClient(path="/tmp/chroma")
 
 
54
 
55
+ # Create or get your KB collection
56
+ kb_collection = chroma_client.get_or_create_collection("KB")
57
+
58
+ COLLECTION_NAME = "KB"
59
  try:
60
  kb_collection = chroma_client.get_collection(COLLECTION_NAME)
61
  except: