Spaces:
Running on Zero
Running on Zero
Short Pages label; Run above the result tabs; result pages not cropped
Browse files415 unmodified lines41641741841942042142242342470 unmodified lines4954964974984995005015023 unmodified lines506507508509510511512415 unmodified linesq_code = gr.Code(label="questions", language="json", lines=18, interactive=True, render=False)with gr.Row():with gr.Column(scale=5):pages = gr.Gallery(label="Pages · drop images here to add them; they are page_1, page_2, … in order",columns=4, height=240, interactive=True, type="filepath", file_types=["image"],object_fit="contain", allow_preview=False)gr.Markdown("### State: the document")@gr.render(inputs=[state_code, pages], triggers=[s_rev.change])70 unmodified lines"when you click out of the editor.</sub>")state_code.render()q_code.render()go = gr.Button("Ask", variant="primary", size="lg")with gr.Column(scale=6):status = gr.Markdown()with gr.Tabs(selected="request") as out_tabs:with gr.Tab("Result", id="result"):3 unmodified linesconf_count = gr.Markdown(elem_classes=["conf-count"])table = gr.Dataframe(headers=["question", "type", "answer", "confidence"], wrap=True,label="Answers", interactive=False)drawn = gr.Gallery(label="Boxes on the pages", columns=2, height=640, visible=False)spans = gr.HighlightedText(label="Spans in the text", combine_adjacent=False, show_legend=True,visible=False)with gr.Tab("Request", id="request"):415 unmodified lines41641741841942042142242342442570 unmodified lines4964974984995005015025033 unmodified lines507508509510511512513415 unmodified linesq_code = gr.Code(label="questions", language="json", lines=18, interactive=True, render=False)with gr.Row():with gr.Column(scale=5):pages = gr.Gallery(label="Pages",columns=4, height=240, interactive=True, type="filepath", file_types=["image"],object_fit="contain", allow_preview=False)gr.Markdown("<sub>Drop images to add pages; they are page_1, page_2, … in order.</sub>")gr.Markdown("### State: the document")@gr.render(inputs=[state_code, pages], triggers=[s_rev.change])70 unmodified lines"when you click out of the editor.</sub>")state_code.render()q_code.render()with gr.Column(scale=6):go = gr.Button("Run", variant="primary", size="lg")status = gr.Markdown()with gr.Tabs(selected="request") as out_tabs:with gr.Tab("Result", id="result"):3 unmodified linesconf_count = gr.Markdown(elem_classes=["conf-count"])table = gr.Dataframe(headers=["question", "type", "answer", "confidence"], wrap=True,label="Answers", interactive=False)drawn = gr.Gallery(label="Boxes on the pages", columns=2, height=640, object_fit="contain", visible=False)spans = gr.HighlightedText(label="Spans in the text", combine_adjacent=False, show_legend=True,visible=False)with gr.Tab("Request", id="request"):
app.py+4-3