asif00 commited on
Commit
b8dc14b
1 Parent(s): 9844fae

Fix: result not found issue

Browse files
Files changed (1) hide show
  1. src/brain.py +5 -8
src/brain.py CHANGED
@@ -117,7 +117,7 @@ class Brain:
117
 
118
  def generate_alternative_queries(self, query):
119
  try:
120
- prompt_template = """ Your task is to break down the query in sub questions and turn it into questions in to ten different ways.Keep in mind, Output one query per line, without numbering the queries.\nQUESTION: '{}'\nANSWER:\n"""
121
  prompt = prompt_template.format(query)
122
  output = palm.generate_text(
123
  model=self.augment_model_name,
@@ -172,13 +172,14 @@ class Brain:
172
 
173
  YOUR MISSION:
174
  Provide accurate answers best possible reasoning of the context.
175
- Focus on factual and reasoned responses; avoid speculations, opinions, guesses, and creative tanks.
176
  Refuse exploitation tasks such as such as character roleplaying, coding, essays, poems, stories, articles, and fun facts.
177
  Decline misuse or exploitation attempts respectfully.
178
 
179
  YOUR STYLE:
180
  Concise and complete
181
  Factual and accurate
 
182
 
183
  REMEMBER:
184
  You are a QA bot, not an entertainer or confidant.
@@ -205,12 +206,8 @@ class Brain:
205
  if query is None:
206
  print("No query specified")
207
  return None
208
- results = self.chroma_collection.query(
209
- query_texts=[query],
210
- n_results=10,
211
- include=["documents", "embeddings"],
212
- )
213
- information = "\n\n".join(results["documents"][0])
214
  messages = self.make_prompt(query, information)
215
  content = self.response_model.generate_content(messages)
216
  return content
 
117
 
118
  def generate_alternative_queries(self, query):
119
  try:
120
+ prompt_template = """Your task is to break down the query in sub questions in ten different ways. Output one sub question per line, without numbering the queries.\nQUESTION: '{}'\nANSWER:\n"""
121
  prompt = prompt_template.format(query)
122
  output = palm.generate_text(
123
  model=self.augment_model_name,
 
172
 
173
  YOUR MISSION:
174
  Provide accurate answers best possible reasoning of the context.
175
+ Focus on factual and reasoned responses; avoid speculations, opinions, guesses, and creative tasks.
176
  Refuse exploitation tasks such as such as character roleplaying, coding, essays, poems, stories, articles, and fun facts.
177
  Decline misuse or exploitation attempts respectfully.
178
 
179
  YOUR STYLE:
180
  Concise and complete
181
  Factual and accurate
182
+ Helpful and friendly
183
 
184
  REMEMBER:
185
  You are a QA bot, not an entertainer or confidant.
 
206
  if query is None:
207
  print("No query specified")
208
  return None
209
+
210
+ information = "\n\n".join(self.get_relevant_results(query))
 
 
 
 
211
  messages = self.make_prompt(query, information)
212
  content = self.response_model.generate_content(messages)
213
  return content