king007 commited on
Commit
adadda8
1 Parent(s): 9f0fc82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -189,5 +189,17 @@ with gr.Blocks() as demo:
189
 
190
  btn.click(question_answer, inputs=[url, file, question,openAI_key], outputs=[answer])
191
  #openai.api_key = os.getenv('Your_Key_Here')
192
- demo.launch()
193
-
 
 
 
 
 
 
 
 
 
 
 
 
 
189
 
190
  btn.click(question_answer, inputs=[url, file, question,openAI_key], outputs=[answer])
191
  #openai.api_key = os.getenv('Your_Key_Here')
192
+ # demo.launch()
193
+ ###################################
194
+ 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>')
195
+ openAI_key=gr.Textbox(label='Enter your OpenAI API key here')
196
+ url = gr.Textbox(label='Enter PDF URL here')
197
+ gr.Markdown("<center><h4>OR<h4></center>")
198
+ file = gr.File(label='Upload your PDF/ Research Paper / Book here', file_types=['.pdf'])
199
+ question = gr.Textbox(label='Enter your question here')
200
+ btn = gr.Button(value='Submit')
201
+ btn.style(full_width=True)
202
+ answer = gr.Textbox(label='The answer to your question is :')
203
+ gr.Interface(fn=question_answer,
204
+ inputs=[url, file, question,openAI_key],
205
+ outputs=[answer]).launch()