Utkarsh-Tiwari commited on
Commit
7cbf76a
·
1 Parent(s): e9413a0

embedding

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -31,10 +31,11 @@ def predict(query,history):
31
  template=template,
32
  )
33
 
 
34
  my_activeloop_org_id = "utkarshtiwari"
35
  my_activeloop_dataset_name = "modelwise_dataset"
36
  dataset_path = f"hub://{my_activeloop_org_id}/{my_activeloop_dataset_name}"
37
- db = DeepLake(dataset_path=dataset_path, read_only=True)
38
  # Retrieve relevant chunks from the Knowledge Base
39
  docs = db.similarity_search(query)
40
  retrieved_chunks = [doc.page_content for doc in docs]
 
31
  template=template,
32
  )
33
 
34
+ embeddings = OpenAIEmbeddings(model="text-embedding-ada-002")
35
  my_activeloop_org_id = "utkarshtiwari"
36
  my_activeloop_dataset_name = "modelwise_dataset"
37
  dataset_path = f"hub://{my_activeloop_org_id}/{my_activeloop_dataset_name}"
38
+ db = DeepLake(dataset_path=dataset_path, read_only=True, embedding_function = embeddings)
39
  # Retrieve relevant chunks from the Knowledge Base
40
  docs = db.similarity_search(query)
41
  retrieved_chunks = [doc.page_content for doc in docs]