TAPASxHF2 / test_question_answerer.py
jskinner215's picture
Upload 17 files
25fc3a2
raw
history blame contribute delete
No virus
587 Bytes
from question_answerer import QuestionAnswerer
def test_question_answerer():
question_answerer = QuestionAnswerer()
# Test processing query
processed_query = question_answerer.process_query("test query")
assert isinstance(processed_query, list)
# Test querying chroma db
table = question_answerer.query_chroma_db(processed_query)
assert isinstance(table, pd.DataFrame)
# Test running TAPAS pipeline
answer = question_answerer.run_tapas_pipeline(processed_query, table)
assert isinstance(answer, dict)
assert "answer" in answer