kadsai commited on
Commit
f3146c5
·
verified ·
1 Parent(s): 3e566a3

update collection recuperation

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -48,11 +48,21 @@ class Query(BaseModel):
48
  temperature: float = 0.7
49
  top_p: float = 0.95
50
 
 
 
 
 
51
  def load_collection(domain, subdomain):
52
  path = os.path.join(VECTORSTORE_BASE_DIR, domain.lower(), subdomain.lower())
 
53
  client_chroma = PersistentClient(path=path)
 
 
 
 
54
  return client_chroma.get_or_create_collection(name=f"{domain.lower()}_{subdomain.lower()}")
55
 
 
56
  def respond(message, history, system_message, domain, subdomain, max_tokens, temperature, top_p):
57
  try:
58
  if subdomain == "incident":
 
48
  temperature: float = 0.7
49
  top_p: float = 0.95
50
 
51
+ #def load_collection(domain, subdomain):
52
+ # path = os.path.join(VECTORSTORE_BASE_DIR, domain.lower(), subdomain.lower())
53
+ # client_chroma = PersistentClient(path=path)
54
+ # return client_chroma.get_or_create_collection(name=f"{domain.lower()}_{subdomain.lower()}")
55
  def load_collection(domain, subdomain):
56
  path = os.path.join(VECTORSTORE_BASE_DIR, domain.lower(), subdomain.lower())
57
+ print(f"🔍 Chargement depuis : {path}")
58
  client_chroma = PersistentClient(path=path)
59
+
60
+ collections = client_chroma.list_collections()
61
+ print("✅ Collections trouvées :", collections)
62
+
63
  return client_chroma.get_or_create_collection(name=f"{domain.lower()}_{subdomain.lower()}")
64
 
65
+
66
  def respond(message, history, system_message, domain, subdomain, max_tokens, temperature, top_p):
67
  try:
68
  if subdomain == "incident":