Spaces:
Sleeping
Sleeping
Update services/qa_service/qna.py
Browse files
services/qa_service/qna.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
import json
|
2 |
|
|
|
|
|
3 |
class QAService:
|
4 |
def __init__(self, conf, pinecone, model_pipeline, question, context):
|
5 |
self.conf = conf
|
@@ -35,7 +37,7 @@ class QAService:
|
|
35 |
def run(self):
|
36 |
"""Query pinecone outputs and infer results"""
|
37 |
output = self.retrieve_context()
|
|
|
38 |
output = self.model_pipeline.infer(output)
|
39 |
|
40 |
return output
|
41 |
-
|
|
|
1 |
import json
|
2 |
|
3 |
+
from services.qa_service.utils import format_prompt
|
4 |
+
|
5 |
class QAService:
|
6 |
def __init__(self, conf, pinecone, model_pipeline, question, context):
|
7 |
self.conf = conf
|
|
|
37 |
def run(self):
|
38 |
"""Query pinecone outputs and infer results"""
|
39 |
output = self.retrieve_context()
|
40 |
+
output = format_prompt(output)
|
41 |
output = self.model_pipeline.infer(output)
|
42 |
|
43 |
return output
|
|