Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ llama_parser = LlamaParse(
|
|
| 26 |
language="en",
|
| 27 |
)
|
| 28 |
|
| 29 |
-
def load_document(file: NamedTemporaryFile, parser: str = "
|
| 30 |
"""Loads and splits the document into pages."""
|
| 31 |
if parser == "pypdf":
|
| 32 |
loader = PyPDFLoader(file.name)
|
|
@@ -192,7 +192,7 @@ with gr.Blocks() as demo:
|
|
| 192 |
|
| 193 |
with gr.Row():
|
| 194 |
file_input = gr.Files(label="Upload your PDF documents", file_types=[".pdf"])
|
| 195 |
-
parser_dropdown = gr.Dropdown(choices=["pypdf", "llamaparse"], label="Select PDF Parser", value="
|
| 196 |
update_button = gr.Button("Upload Document")
|
| 197 |
|
| 198 |
update_output = gr.Textbox(label="Update Status")
|
|
|
|
| 26 |
language="en",
|
| 27 |
)
|
| 28 |
|
| 29 |
+
def load_document(file: NamedTemporaryFile, parser: str = "llamaparse") -> List[Document]:
|
| 30 |
"""Loads and splits the document into pages."""
|
| 31 |
if parser == "pypdf":
|
| 32 |
loader = PyPDFLoader(file.name)
|
|
|
|
| 192 |
|
| 193 |
with gr.Row():
|
| 194 |
file_input = gr.Files(label="Upload your PDF documents", file_types=[".pdf"])
|
| 195 |
+
parser_dropdown = gr.Dropdown(choices=["pypdf", "llamaparse"], label="Select PDF Parser", value="llamaparse")
|
| 196 |
update_button = gr.Button("Upload Document")
|
| 197 |
|
| 198 |
update_output = gr.Textbox(label="Update Status")
|