Mbonea commited on
Commit
2a4cafb
·
1 Parent(s): 0bbe0b5

fixed the task_id bug

Browse files
Files changed (1) hide show
  1. App/Embedding/utils/Initialize.py +2 -3
App/Embedding/utils/Initialize.py CHANGED
@@ -25,7 +25,7 @@ async def delete_documents(task_id):
25
 
26
  docsearch.delete(
27
  filter={
28
- "task_id": {"$eq": "task_id"},
29
  }
30
  )
31
 
@@ -68,7 +68,7 @@ def search(query: str, task_id: str):
68
  docsearch = Pinecone.from_existing_index(index_name, embeddings)
69
 
70
  filtering_conditions = {
71
- "task_id": {"$eq": "task_id"},
72
  }
73
  data =docsearch.similarity_search(query, k=4, filter=filtering_conditions)
74
  return [
@@ -79,7 +79,6 @@ def search(query: str, task_id: str):
79
 
80
 
81
  def encode(temp: list[Document]):
82
- print(temp)
83
  PINECONE_API_KEY = os.environ.get("PINECONE_API_KEY")
84
  # find your environment next to the api key in pinecone console
85
  PINECONE_ENV = os.environ.get("PINECONE_ENVIRONMENT")
 
25
 
26
  docsearch.delete(
27
  filter={
28
+ "task_id": {"$eq": task_id},
29
  }
30
  )
31
 
 
68
  docsearch = Pinecone.from_existing_index(index_name, embeddings)
69
 
70
  filtering_conditions = {
71
+ "task_id": {"$eq": task_id},
72
  }
73
  data =docsearch.similarity_search(query, k=4, filter=filtering_conditions)
74
  return [
 
79
 
80
 
81
  def encode(temp: list[Document]):
 
82
  PINECONE_API_KEY = os.environ.get("PINECONE_API_KEY")
83
  # find your environment next to the api key in pinecone console
84
  PINECONE_ENV = os.environ.get("PINECONE_ENVIRONMENT")