Skip to content

Commit

Permalink
Increase retrieval from 80 to 120 docs, especially for Ollama
Browse files Browse the repository at this point in the history
  • Loading branch information
KastanDay committed Jul 31, 2024
1 parent d0dd87d commit 4f8b3fb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ai_ta_backend/service/retrieval_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,12 @@ def delete_from_nomic_and_supabase(self, course_name: str, identifier_key: str,
# data = response.data[0] # single record fetched
# nomic_ids_to_delete = [str(data['id']) + "_" + str(i) for i in range(1, len(data['contexts']) + 1)]

# delete from Nomic
# response = self.sqlDb.getProjectsMapForCourse(course_name)
# if not response.data:
# raise Exception(f"No document map found for this course: {course_name}")
# project_id = response.data[0]['doc_map_id']
# self.nomicService.delete_from_document_map(project_id, nomic_ids_to_delete)
# delete from Nomic
# response = self.sqlDb.getProjectsMapForCourse(course_name)
# if not response.data:
# raise Exception(f"No document map found for this course: {course_name}")
# project_id = response.data[0]['doc_map_id']
# self.nomicService.delete_from_document_map(project_id, nomic_ids_to_delete)
# except Exception as e:
# print(f"Nomic Error in deleting. {identifier_key}: {identifier_value}", e)
# self.sentry.capture_exception(e)
Expand Down Expand Up @@ -365,7 +365,7 @@ def vector_search(self, search_query, course_name, doc_groups: List[str] | None
disabled_doc_groups = []

# Max number of search results to return
top_n = 80
top_n = 120
# Embed the user query and measure the latency
user_query_embedding = self._embed_query_and_measure_latency(search_query)
# Capture the search invoked event to PostHog
Expand Down

0 comments on commit 4f8b3fb

Please sign in to comment.