NeuralDrafter / app.py
IotaCluster's picture
Update app.py
c99852b verified
raw
history blame contribute delete
779 Bytes
import gradio as gr
from draft_pipeline import process_document_pipeline
def process_document(doc_file):
images, dictionaries, compiled_doc = process_document_pipeline(doc_file.name)
return compiled_doc
with gr.Blocks() as demo:
gr.Markdown("## ๐Ÿ“š Document Processing Pipeline")
gr.Markdown("Upload a `.docx` file. It will be processed and a compiled document will be ready for download.")
with gr.Row():
input_file = gr.File(label="๐Ÿ“„ Upload .docx Document", file_types=[".docx"])
output_file = gr.File(label="โฌ‡๏ธ Download Processed Document")
process_btn = gr.Button("๐Ÿš€ Process Document")
# Logic: when button is clicked
process_btn.click(fn=process_document, inputs=input_file, outputs=output_file)
demo.launch()