Update app.py
Browse files
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("
|
| 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()
|