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()