pdf-to-markdown / app.py
Liam Dyer
temp
658b64e unverified
raw
history blame
525 Bytes
import spaces
import gradio as gr
from marker.convert import convert_single_pdf
from marker.models import load_all_models
@spaces.GPU
def convert(file_path):
model_lst = load_all_models()
full_text, images, out_meta = convert_single_pdf(
file_path,
model_lst,
max_pages=None,
langs=None,
batch_multiplier=16,
)
return full_text
gr.Interface(
convert,
inputs=gr.File(label="PDF file", type="filepath"),
outputs=gr.Markdown(label="Markdown"),
).launch()