Skip to content

Commit

Permalink
fix first page only parsing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingWithTim committed Dec 30, 2024
1 parent 8da825b commit d5efd2c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions fastchat/serve/gradio_block_arena_vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ def wrap_pdfchat_query(query, document):
document_context = f"""
The following is the content of a document:
{document}
Based on this document, answer the following question:
{query}
Based on this document, answer the user query.
"""

reformatted_query_context = (
Expand All @@ -236,13 +235,13 @@ def parse_pdf(file_path):
assert (
"LLAMA_CLOUD_API_KEY" in os.environ
), "Make sure to specify LlamaParse API key."
document = LlamaParse(
documents = LlamaParse(
result_type="markdown",
verbose=True,
).load_data(file_path)
assert len(document) > 0
output = document[0].text

assert len(documents) > 0
output = "\n".join([doc.text for doc in documents])

return output

Expand Down

0 comments on commit d5efd2c

Please sign in to comment.