wfranco's picture
Update app.py
787a70a
raw
history blame
571 Bytes
import gradio as gr
def read_pdf(file_obj):
# Here, file_obj is a file object that Gradio passes to the function.
# You can read this file object using a PDF reading library, such as PyPDF2 or pdfplumber.
# For illustration, replace the following line with your own PDF processing logic.
text = "Processed PDF content here"
return text
iface = gr.Interface(
fn=read_pdf,
inputs=gr.inputs.File(type="file", label="Upload PDF"),
outputs="text",
title="PDF Processor",
description="Upload a PDF file to process."
)
iface.launch()