lekkalar commited on
Commit
449a709
1 Parent(s): 85d6284

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -48,21 +48,20 @@ with gr.Blocks(css=css,theme=gr.themes.Monochrome()) as demo:
48
  with gr.Column():
49
  openai_key = gr.Textbox(label="Your GPT-4 OpenAI API key", type="password")
50
  pdf_doc = gr.File(label="Load a pdf",file_types=['.pdf'],type='file')
 
 
 
 
51
  with gr.Row():
52
- langchain_status = gr.Textbox(label="Status", placeholder="", interactive=False)
53
- load_pdf = gr.Button("Load PDF to LangChain")
 
54
 
55
- chatbot = gr.Chatbot([], elem_id="chatbot").style(height=350)
56
- question = gr.Textbox(label="Question", placeholder="Type your question and hit Enter ")
57
- submit_btn = gr.Button("Send Message")
58
 
59
- load_pdf.click(load_pdf, inputs=[pdf_doc, openai_key], outputs=[langchain_status], queue=False)
60
 
61
- submit_btn.click(answer_query,question,chatbot)
62
 
63
 
64
  #forcing a save in order to re-build the container.
65
  demo.launch()
66
-
67
-
68
-
 
48
  with gr.Column():
49
  openai_key = gr.Textbox(label="Your GPT-4 OpenAI API key", type="password")
50
  pdf_doc = gr.File(label="Load a pdf",file_types=['.pdf'],type='file')
51
+
52
+ with gr.Row():
53
+ status = gr.Textbox(label="Status", placeholder="", interactive=False)
54
+ load_pdf = gr.Button("Load PDF to LangChain")
55
  with gr.Row():
56
+ input = gr.Textbox(label="Type in your question")
57
+ output = gr.Textbox(label="Answer")
58
+ submit_query = gr.Button("Submit")
59
 
 
 
 
60
 
61
+ load_pdf.click(load_pdf, inputs=[pdf_doc, openai_key], outputs=status)
62
 
63
+ submit_btn.click(answer_query,input,ouput)
64
 
65
 
66
  #forcing a save in order to re-build the container.
67
  demo.launch()