File size: 493 Bytes
e8e2778 f88e951 e8e2778 f88e951 e8e2778 f88e951 f5184a9 f88e951 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import gradio as gr
def process_input(message, pdf_file):
print("Received Message:", message)
print("Received PDF File:", pdf_file.name)
# Save the received PDF file
with open("received_pdf.pdf", "wb") as output_file:
output_file.write(pdf_file.read())
return "Processing complete. Check the console for details."
iface = gr.Interface(
fn=process_input,
inputs=["text", gr.File(type="pdf", label="Upload PDF")],
outputs="text"
)
iface.launch()
|