chat-your-case / cli_app.py
danielcwq's picture
Update cli_app.py
4a8b6b1
raw
history blame contribute delete
515 Bytes
import pickle
from query_data import get_chain
if __name__ == "__main__":
with open("case1vectorstore.pkl", "rb") as f:
vectorstore = pickle.load(f)
qa_chain = get_chain(vectorstore)
chat_history = []
print("Chat with your docs!")
while True:
print("Human:")
question = input()
result = qa_chain({"question": question, "chat_history": chat_history})
chat_history.append((question, result["answer"]))
print("AI:")
print(result["answer"])