Spaces:
Sleeping
Sleeping
Update services/qa_service/qna.py
Browse files
services/qa_service/qna.py
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
import json
|
2 |
|
3 |
class QAService:
|
4 |
-
def __init__(self, conf, pinecone,
|
5 |
self.conf = conf
|
6 |
self.pc = pinecone['connection']
|
7 |
self.embedder = pinecone['embedder']
|
8 |
-
self.
|
9 |
self.question = question
|
10 |
self.context = context
|
11 |
|
@@ -35,7 +35,7 @@ class QAService:
|
|
35 |
def run(self):
|
36 |
"""Query pinecone outputs and infer results"""
|
37 |
output = self.retrieve_context()
|
38 |
-
output = self.
|
39 |
|
40 |
return output
|
41 |
|
|
|
1 |
import json
|
2 |
|
3 |
class QAService:
|
4 |
+
def __init__(self, conf, pinecone, model_pipeline, question, context):
|
5 |
self.conf = conf
|
6 |
self.pc = pinecone['connection']
|
7 |
self.embedder = pinecone['embedder']
|
8 |
+
self.model_pipeline = model_pipeline
|
9 |
self.question = question
|
10 |
self.context = context
|
11 |
|
|
|
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 |
|