Chandranshu Jain commited on
Commit
ff5bb34
1 Parent(s): d7a19b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -45,8 +45,10 @@ GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
45
 
46
  def embedding(chunk):
47
  embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
48
- vector = Chroma.from_documents(chunk)
49
- db = Chroma.from_documents(vector, embeddings, persist_directory="./chroma_db")
 
 
50
 
51
  def get_conversational_chain():
52
  prompt_template = """
@@ -64,7 +66,6 @@ def get_conversational_chain():
64
 
65
  def user_call(query):
66
  embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
67
- Chroma = chromadb.HttpClient(host='127.0.0.1', port=8000, settings=Settings(allow_reset=True, anonymized_telemetry=False))
68
  db3 = Chroma(persist_directory="./chroma_db", embedding_function=embeddings)
69
  docs = db3.similarity_search(query)
70
  chain = get_conversational_chain()
 
45
 
46
  def embedding(chunk):
47
  embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
48
+ #vector = Chroma.from_documents(chunk)
49
+ new_client = chromadb.EphemeralClient(
50
+ db = Chroma.from_documents(vector, embeddings,client=new_client
51
+ , persist_directory="./chroma_db")
52
 
53
  def get_conversational_chain():
54
  prompt_template = """
 
66
 
67
  def user_call(query):
68
  embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
 
69
  db3 = Chroma(persist_directory="./chroma_db", embedding_function=embeddings)
70
  docs = db3.similarity_search(query)
71
  chain = get_conversational_chain()