joshuadunlop commited on
Commit
4d13de1
·
1 Parent(s): 0aa2072

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -20
app.py CHANGED
@@ -153,24 +153,8 @@ recommender = SemanticSearch()
153
  title = 'PDF GPT'
154
  description = """ PDF GPT allows you to chat with your PDF file using Universal Sentence Encoder and Open AI. It gives hallucination free response than other tools as the embeddings are better than OpenAI. The returned response can even cite the page number in square brackets([]) where the information is located, adding credibility to the responses and helping to locate pertinent information quickly."""
155
 
156
- with gr.Interface() as demo:
 
 
157
 
158
- gr.Markdown(f'<center><h1>{title}</h1></center>')
159
- gr.Markdown(description)
160
-
161
- with gr.SideBar():
162
- gr.Markdown(f'<p style="text-align:center">Get your Open AI API key <a href="https://platform.openai.com/account/api-keys">here</a></p>')
163
- openAI_key=gr.Textbox(label='Enter your OpenAI API key here')
164
-
165
- with gr.Column():
166
- url = gr.Textbox(label='Enter PDF URL here')
167
- gr.Markdown("<center><h4>OR<h4></center>")
168
- file = gr.File(label='Upload your PDF/ Research Paper / Book here', file_types=['.pdf'])
169
- question = gr.Textbox(label='Enter your question here')
170
- btn = gr.Button(value='Submit')
171
- btn.style(full_width=True)
172
- answer = gr.Textbox(label='The answer to your question is :')
173
-
174
- btn.click(question_answer, inputs=[url, file, question,openAI_key], outputs=[answer])
175
-
176
- demo.launch()
 
153
  title = 'PDF GPT'
154
  description = """ PDF GPT allows you to chat with your PDF file using Universal Sentence Encoder and Open AI. It gives hallucination free response than other tools as the embeddings are better than OpenAI. The returned response can even cite the page number in square brackets([]) where the information is located, adding credibility to the responses and helping to locate pertinent information quickly."""
155
 
156
+ iface = gr.Interface(fn=question_answer,
157
+ inputs=["textbox", "file", "textbox", "textbox"],
158
+ outputs="textbox")
159
 
160
+ iface.launch()