Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ from langchain.chains import RetrievalQA # for conversing with chatGPT
|
|
10 |
from langchain.chat_models import ChatOpenAI # the LLM model we'll use (ChatGPT)
|
11 |
|
12 |
|
13 |
-
def
|
14 |
if openai_key is not None:
|
15 |
os.environ['OPENAI_API_KEY'] = open_ai_key
|
16 |
#Load the pdf file
|
@@ -58,7 +58,7 @@ with gr.Blocks(css=css,theme=gr.themes.Monochrome()) as demo:
|
|
58 |
submit_query = gr.Button("Submit")
|
59 |
|
60 |
|
61 |
-
load_pdf.click(
|
62 |
|
63 |
submit_btn.click(answer_query,input,ouput)
|
64 |
|
|
|
10 |
from langchain.chat_models import ChatOpenAI # the LLM model we'll use (ChatGPT)
|
11 |
|
12 |
|
13 |
+
def load_doc(pdf_doc, open_ai_key):
|
14 |
if openai_key is not None:
|
15 |
os.environ['OPENAI_API_KEY'] = open_ai_key
|
16 |
#Load the pdf file
|
|
|
58 |
submit_query = gr.Button("Submit")
|
59 |
|
60 |
|
61 |
+
load_pdf.click(load_doc, inputs=[pdf_doc, openai_key], outputs=status)
|
62 |
|
63 |
submit_btn.click(answer_query,input,ouput)
|
64 |
|