tykiww commited on
Commit
913fed9
·
verified ·
1 Parent(s): 8f62329

Update services/qa_service/qna.py

Browse files
Files changed (1) hide show
  1. services/qa_service/qna.py +3 -3
services/qa_service/qna.py CHANGED
@@ -26,7 +26,7 @@ class QAService:
26
 
27
  level_1 = i['matches']
28
  level_2 = level_1['metadata']['_node_content']
29
- collect = json.loads(level_2)
30
  parsed.append(collect)
31
 
32
  return collect
@@ -42,13 +42,13 @@ class QAService:
42
  include_metadata=True
43
  )
44
 
45
- output = self.parse_results(result)["text"]
46
 
47
  return output
48
 
49
  def run(self):
50
  """Query pinecone outputs and infer results"""
51
- context = self.retrieve_context()
52
  prompt = format_prompt(self.question, context)
53
  output = self.model_pipeline.infer(prompt)
54
 
 
26
 
27
  level_1 = i['matches']
28
  level_2 = level_1['metadata']['_node_content']
29
+ collect = json.loads(level_2)["text"]
30
  parsed.append(collect)
31
 
32
  return collect
 
42
  include_metadata=True
43
  )
44
 
45
+ output = self.parse_results(result)
46
 
47
  return output
48
 
49
  def run(self):
50
  """Query pinecone outputs and infer results"""
51
+ context = '\n'.join(self.retrieve_context())
52
  prompt = format_prompt(self.question, context)
53
  output = self.model_pipeline.infer(prompt)
54