import gradio as gr from modules.pdf_processor import process_pdf def handle_pdf(input_pdf): # Process the uploaded PDF and return the path to the modified PDF output_pdf = process_pdf(input_pdf) return output_pdf # Define Gradio interface iface = gr.Interface( fn=handle_pdf, inputs=gr.File(label="Upload your PDF", type="filepath"), # Use filepath for file handling outputs=gr.File(label="Download Processed PDF"), title="Vector Data to Editable Text Converter", description="Upload a PDF file to replace vector data with editable text. Output will retain original structure." ) if __name__ == "__main__": iface.launch()