Spaces:
Runtime error
Runtime error
File size: 873 Bytes
68c32d7 dedfe3d 68c32d7 dedfe3d 97c6a38 68c32d7 97c6a38 68c32d7 bb1953f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
import json
import os
import re
import statistics
import gradio as gr
import pandas as pd
from pdftoqa_generator import *
def predict(file):
resource = pdf_parser(file)
qa_notes = qa_generator(resource)
return qa_notes
description = """Do you have a long document and a bunch of questions that can be answered given the data in this file?
Fear not for this demo is for you.
Upload your pdf, ask your questions and wait for the magic to happen.
DISCLAIMER: I do no have idea what happens to the pdfs that you upload and who has access to them so make sure there is nothing confidential inside it.
"""
title = "Note Maker."
pdf_doc=gr.File(label="Load a pdf", file_types=['.pdf'], type="file")
iface = gr.Interface(
fn=predict,
inputs=[pdf_doc],
outputs="text",
description=description,
title=title,
)
iface.launch(show_error=True)
|