Spaces:
Sleeping
Sleeping
import gradio as gr | |
import pdfminer | |
from pdfminer.high_level import extract_text | |
def read_pdf(file): | |
if file is None: | |
return "No file uploaded" | |
text = extract_text(file.name) | |
return text | |
iface = gr.Interface( | |
fn=read_pdf, | |
inputs=gr.File(label="Upload PDF file"), | |
outputs=gr.Textbox(label="Extracted Text") | |
) | |
if __name__ == "__main__": | |
iface.launch() |