raghuram13 commited on
Commit
e799a24
·
1 Parent(s): 0f4521b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -57,7 +57,7 @@ def extract_info(pdf_file):
57
 
58
  #Remove directory with initial text file
59
  #shutil.rmtree(directory_name)
60
- return ("Success! You can now click on the 'Knowledge bot' tab to interact with your document")
61
 
62
 
63
  def chat(chat_history, user_input):
@@ -82,9 +82,10 @@ with gr.Blocks() as demo:
82
 
83
  with gr.Tab('Input PDF document here'):
84
  text_input = gr.File()
 
85
  text_output = gr.Textbox()
86
  text_button = gr.Button('Build the bot!')
87
- text_button.click(extract_info, text_input, text_output)
88
  with gr.Tab('Knowledge bot'):
89
  chatbot = gr.Chatbot()
90
  message = gr.Textbox(label = 'Ask here your question about the document, then press "enter" and scroll up for response')
 
57
 
58
  #Remove directory with initial text file
59
  #shutil.rmtree(directory_name)
60
+ return ("Success! You can now click on the 'Knowledge bot' tab to interact with your document"), extracted_text
61
 
62
 
63
  def chat(chat_history, user_input):
 
82
 
83
  with gr.Tab('Input PDF document here'):
84
  text_input = gr.File()
85
+ success_output = gr.Textbox()
86
  text_output = gr.Textbox()
87
  text_button = gr.Button('Build the bot!')
88
+ text_button.click(extract_info, text_input, [success_output,text_output])
89
  with gr.Tab('Knowledge bot'):
90
  chatbot = gr.Chatbot()
91
  message = gr.Textbox(label = 'Ask here your question about the document, then press "enter" and scroll up for response')