import gradio as gr import functions as functions # pre-defined questions questions = [ "What did the study investigate?", "Can you provide a summary of this paper?", "what are the methodologies used in this study?", "what are the data intervals used in this study? Give me the start dates and end dates?", "what are the main limitations of this study?", "what are the main shortcomings of this study?", "what are the main findings of the study?", "what are the main results of the study?", "what are the main contributions of this study?", "what is the conclusion of this paper?", "what are the input features used in this study?", "what is the dependent variable in this study?", ] title = 'PDF GPT Turbo' description = """ PDF GPT Turbo allows you to chat with your PDF files. It uses Google's Universal Sentence Encoder with Deep averaging network (DAN) to give hallucination free response by improving the embedding quality of OpenAI. It cites the page number in square brackets([Page No.]) and shows where the information is located, adding credibility to the responses.""" with gr.Blocks(css="""#chatbot { font-size: 14px; min-height: 1200; }""") as demo: gr.Markdown(f'
Get your Open AI API key here
') with gr.Accordion("API Key"): openAI_key = gr.Textbox(label='Enter your OpenAI API key here', type='password') url = gr.Textbox(label='Enter PDF URL here (Example: https://arxiv.org/pdf/1706.03762.pdf )') gr.Markdown("