pgray64 commited on
Commit
534e71b
·
verified ·
1 Parent(s): 0932db4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
app.py CHANGED
@@ -152,16 +152,13 @@ with gr.Blocks() as demo:
152
  gr.Markdown("This App answers a question for documents in PDF or image formats.")
153
 
154
  with gr.Row():
155
- text_input = gr.Textbox(label="Text Input", placeholder="Enter text content here...")
156
  file_input = gr.File(label="File Upload", file_types=['png', 'jpeg', 'jpg', 'bmp', 'gif', 'pdf'])
157
 
158
  question = gr.Textbox(label="Question", placeholder="Enter your question here...")
159
  output = gr.Textbox(label="Answer", placeholder="The result will appear here...")
160
 
161
- text_input.change(lambda x: gr.update(visible=not x), inputs=text_input, outputs=file_input)
162
- file_input.change(lambda x: gr.update(visible=not x), inputs=file_input, outputs=text_input)
163
 
164
- button = gr.Button("Get Answer")
165
  button.click(answer_the_question_for_doc, inputs=[text_input, file_input, question],
166
  outputs=output)
167
  demo.launch()
 
152
  gr.Markdown("This App answers a question for documents in PDF or image formats.")
153
 
154
  with gr.Row():
 
155
  file_input = gr.File(label="File Upload", file_types=['png', 'jpeg', 'jpg', 'bmp', 'gif', 'pdf'])
156
 
157
  question = gr.Textbox(label="Question", placeholder="Enter your question here...")
158
  output = gr.Textbox(label="Answer", placeholder="The result will appear here...")
159
 
 
 
160
 
161
+ button = gr.Button("Run model")
162
  button.click(answer_the_question_for_doc, inputs=[text_input, file_input, question],
163
  outputs=output)
164
  demo.launch()