Spaces:
Runtime error
Runtime error
Commit
·
23d5a88
1
Parent(s):
cda9639
Update app.py
Browse files
app.py
CHANGED
@@ -206,25 +206,7 @@ with gr.Blocks() as demo:
|
|
206 |
|
207 |
gr.Markdown(f'<center><h1>{title}</h1></center>')
|
208 |
gr.Markdown(description)
|
209 |
-
|
210 |
with gr.Row():
|
211 |
-
|
212 |
-
with gr.Group():
|
213 |
-
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>')
|
214 |
-
openAI_key=gr.Textbox(label='Enter your OpenAI API key here')
|
215 |
-
url = gr.Textbox(label='Enter PDF URL here')
|
216 |
-
gr.Markdown("<center><h4>OR<h4></center>")
|
217 |
-
file = gr.File(label='Upload your PDF/ Research Paper / Book here', file_types=['.pdf'])
|
218 |
-
question = gr.Textbox(label='Enter your question here')
|
219 |
-
btn = gr.Button(value='Submit')
|
220 |
-
btn.style(full_width=True)
|
221 |
-
|
222 |
-
with gr.Group():
|
223 |
-
answer = gr.Textbox(label='The answer to your question is :')
|
224 |
-
|
225 |
-
btn.click(question_answer, inputs=[url, file, question,openAI_key], outputs=[answer])
|
226 |
-
with gr.Row():
|
227 |
-
|
228 |
with gr.Group():
|
229 |
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>')
|
230 |
openAI_key = gr.Textbox(label='Enter your OpenAI API key here')
|
@@ -236,12 +218,8 @@ with gr.Blocks() as demo:
|
|
236 |
end_page = gr.Textbox(label='End on page (optional):', numeric=True)
|
237 |
btn = gr.Button(value='Submit')
|
238 |
btn.style(full_width=True)
|
239 |
-
|
240 |
with gr.Group():
|
241 |
answer = gr.Textbox(label='The answer to your question is :')
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
#openai.api_key = os.getenv('Your_Key_Here')
|
247 |
demo.launch()
|
|
|
206 |
|
207 |
gr.Markdown(f'<center><h1>{title}</h1></center>')
|
208 |
gr.Markdown(description)
|
|
|
209 |
with gr.Row():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
with gr.Group():
|
211 |
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>')
|
212 |
openAI_key = gr.Textbox(label='Enter your OpenAI API key here')
|
|
|
218 |
end_page = gr.Textbox(label='End on page (optional):', numeric=True)
|
219 |
btn = gr.Button(value='Submit')
|
220 |
btn.style(full_width=True)
|
|
|
221 |
with gr.Group():
|
222 |
answer = gr.Textbox(label='The answer to your question is :')
|
223 |
+
btn.click(question_answer, inputs=[url, file, question, openAI_key, start_page, end_page], outputs=[answer])
|
224 |
+
|
|
|
|
|
|
|
225 |
demo.launch()
|