Update app.py
Browse files
app.py
CHANGED
@@ -282,7 +282,7 @@ with gr.Blocks(css=css,theme=gr.themes.Monochrome()) as demo:
|
|
282 |
|
283 |
with gr.Tab("Chatbot"):
|
284 |
with gr.Column():
|
285 |
-
|
286 |
pdf_doc = gr.File(label="Load a pdf",file_types=['.pdf'],type='file')
|
287 |
relevant_pages = gr.Textbox(label="*Optional - List comma separated page numbers to load or leave this field blank to use the entire PDF")
|
288 |
|
@@ -580,7 +580,7 @@ with gr.Blocks(css=css,theme=gr.themes.Monochrome()) as demo:
|
|
580 |
load_csv = gr.Button("Upload data into the database").style(full_width=False)
|
581 |
|
582 |
|
583 |
-
load_pdf.click(load_pdf_and_generate_embeddings, inputs=[pdf_doc, relevant_pages], outputs=status)
|
584 |
load_csv.click(load_csv_and_store_questionset_into_sqlite, inputs=[csv_file, document_type_for_questionset, tag_for_questionset], outputs=status_for_loading_csv)
|
585 |
|
586 |
load_questionsets.click(retrieve_document_type_and_questionsettag_from_sqlite,outputs=questionsets)
|
|
|
282 |
|
283 |
with gr.Tab("Chatbot"):
|
284 |
with gr.Column():
|
285 |
+
open_ai_key = gr.Textbox(label="Your GPT-4 OpenAI API key", type="password")
|
286 |
pdf_doc = gr.File(label="Load a pdf",file_types=['.pdf'],type='file')
|
287 |
relevant_pages = gr.Textbox(label="*Optional - List comma separated page numbers to load or leave this field blank to use the entire PDF")
|
288 |
|
|
|
580 |
load_csv = gr.Button("Upload data into the database").style(full_width=False)
|
581 |
|
582 |
|
583 |
+
load_pdf.click(load_pdf_and_generate_embeddings, inputs=[pdf_doc, open_ai_key, relevant_pages], outputs=status)
|
584 |
load_csv.click(load_csv_and_store_questionset_into_sqlite, inputs=[csv_file, document_type_for_questionset, tag_for_questionset], outputs=status_for_loading_csv)
|
585 |
|
586 |
load_questionsets.click(retrieve_document_type_and_questionsettag_from_sqlite,outputs=questionsets)
|