import gradio as gr from gradio_simpletextextractfrompdf import SimpleTextExtractFromPDF def first_200_chars(text): return text[:200] demo = gr.Interface( fn=first_200_chars, inputs=SimpleTextExtractFromPDF(label="Upload a PDF file"), outputs="text", title="First 200 Characters", description="Enter some text and see the first 200 characters.", ) demo.launch()