Spaces:
Sleeping
Sleeping
Commit ·
dbc1154
1
Parent(s): 7a019fc
using os.environ
Browse files
app.py
CHANGED
|
@@ -176,7 +176,7 @@ with gr.Blocks() as demo:
|
|
| 176 |
|
| 177 |
with gr.Group():
|
| 178 |
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>')
|
| 179 |
-
openAI_key = os.
|
| 180 |
url = gr.Textbox(label='Enter PDF URL here')
|
| 181 |
gr.Markdown("<center><h4>OR<h4></center>")
|
| 182 |
file = gr.File(label='Upload your PDF/ Research Paper / Book here', file_types=['.pdf'])
|
|
@@ -188,6 +188,6 @@ with gr.Blocks() as demo:
|
|
| 188 |
answer = gr.Textbox(label='The answer to your question is :')
|
| 189 |
|
| 190 |
btn.click(question_answer, inputs=[url, file, question,openAI_key], outputs=[answer])
|
| 191 |
-
openai.api_key = os.
|
| 192 |
demo.launch()
|
| 193 |
|
|
|
|
| 176 |
|
| 177 |
with gr.Group():
|
| 178 |
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>')
|
| 179 |
+
openAI_key = os.environ['Your_Key_Here']
|
| 180 |
url = gr.Textbox(label='Enter PDF URL here')
|
| 181 |
gr.Markdown("<center><h4>OR<h4></center>")
|
| 182 |
file = gr.File(label='Upload your PDF/ Research Paper / Book here', file_types=['.pdf'])
|
|
|
|
| 188 |
answer = gr.Textbox(label='The answer to your question is :')
|
| 189 |
|
| 190 |
btn.click(question_answer, inputs=[url, file, question,openAI_key], outputs=[answer])
|
| 191 |
+
openai.api_key = os.environ['Your_Key_Here']
|
| 192 |
demo.launch()
|
| 193 |
|