Find answers from the community

Updated 6 months ago

how to load all documents in the data

At a glance

The community member posted a code snippet to load all documents in the "data" folder using the parser_gpt4o.load_data("./data") function. In the comments, another community member asked how the parser was created and if it could be shared. Another community member provided more details on the parser, including using the LlamaParse class with specific parameters. This community member also mentioned that they were able to load a single PDF file from the "data" directory, but needed to load all PDF files in that directory. Finally, another community member commented that they changed to a list and it worked. There is no explicitly marked answer in the comments.

how to load all documents in the data folder

documents_gpt4o = parser_gpt4o.load_data("./data")
W
m
4 comments
How did you created this parser? can you share that?
Also the folder dir goes into the parser
from llama_parse import LlamaParse

parser_gpt4o = LlamaParse(
result_type="markdown",
# api_key=api_key,
gpt4o_mode=True,
# gpt4o_api_key="<gpt4o_api_key>"
)

documents_gpt4o = parser_gpt4o.load_data("./data/Market Report_15 May 2024.pdf")

this works fines

But I need to load all pdf files from "data" directory
i changed to list and it works thanks
Add a reply
Sign up and join the conversation on Discord