Prakruti_LLM / main.py
Rohankumar31's picture
Upload 3 files
0c83e83
raw
history blame contribute delete
665 Bytes
import pandas as pd
import model
def chatbot(question):
# Provide a context or passage where the answer can be found
with open(r"Data.txt", "r", encoding="utf-8") as file:
context = file.read()
# Use the question-answering model to find the answer
answer = model.qa_pipeline(question=question, context=context)
return answer
def prints(questions):
response = chatbot(questions)
# print(f"Question: {question}")
# print(f"Answer: {response['answer']}")
# print(f"Confidence: {response['score']:.4f}")
# print()
return response['answer']
# result = prints(stream.query)
# print(result)
# stream.receive_data(result)