Created
October 2, 2023 17:42
-
-
Save fsndzomga/8fd9398ed5913212a4616ac0f7b02ebc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if __name__ == "__main__": | |
pdf_name = input("What is the name of the PDF file you want to chat with ?\n\n") | |
# Check if the provided name has the .pdf extension and add it if not | |
if not pdf_name.lower().endswith('.pdf'): | |
pdf_name += '.pdf' | |
pdf_folder = 'pdfs' | |
pdf_path = os.path.join(pdf_folder, pdf_name) | |
responder = Backend(pdf_path) | |
while True: | |
question = input("\nEnter your question about the document or type quit:\n\n") | |
if question == 'quit': | |
break | |
response = responder(question) | |
print("\n", response) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment