abadesalex's picture
Update to Qdrant db
47b5f0c
raw
history blame
317 Bytes
from transformers import pipeline
class QuestionAnswering:
def __init__(self, qa_pipeline: pipeline):
self.qa_pipeline = qa_pipeline
def answer_question(self, question: str, context: str) -> str:
result = self.qa_pipeline(question=question, context=context)
return result["answer"]