feat: Async api (#60)

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
Michele Dolfi
2025-03-07 11:26:50 +01:00
committed by GitHub
parent ed851c95fe
commit 82f8900197
26 changed files with 919 additions and 367 deletions

View File

@@ -333,7 +333,6 @@ with gr.Blocks(
title="Docling Serve",
delete_cache=(3600, 3600), # Delete all files older than 1 hour every hour
) as ui:
# Constants stored in states to be able to pass them as inputs to functions
processing_text = gr.State("Processing your document(s), please wait...")
true_bool = gr.State(True)
@@ -593,9 +592,7 @@ with gr.Blocks(
set_outputs_visibility_direct,
inputs=[false_bool, false_bool],
outputs=[content_output, file_output],
).then(
clear_url_input, inputs=None, outputs=[url_input]
)
).then(clear_url_input, inputs=None, outputs=[url_input])
# File processing
file_process_btn.click(
@@ -664,6 +661,4 @@ with gr.Blocks(
set_outputs_visibility_direct,
inputs=[false_bool, false_bool],
outputs=[content_output, file_output],
).then(
clear_file_input, inputs=None, outputs=[file_input]
)
).then(clear_file_input, inputs=None, outputs=[file_input])