Skip to content

Instantly share code, notes, and snippets.

@fsndzomga
Created October 2, 2023 17:42
Show Gist options
  • Save fsndzomga/8fd9398ed5913212a4616ac0f7b02ebc to your computer and use it in GitHub Desktop.
Save fsndzomga/8fd9398ed5913212a4616ac0f7b02ebc to your computer and use it in GitHub Desktop.
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