Skip to content

Commit

Permalink
add a new demo
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmosShadow committed Jul 5, 2024
1 parent 5cef400 commit 8a21c8f
Show file tree
Hide file tree
Showing 12 changed files with 335 additions and 1 deletion.
Binary file added examples/rh.pdf
Binary file not shown.
Binary file added examples/rh/0_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/rh/0_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/rh/2_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/rh/5_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/rh/5_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/rh/6_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/rh/7_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/rh/8_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/rh/9_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
331 changes: 331 additions & 0 deletions examples/rh/output.md

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
pdf_path = '../examples/attention_is_all_you_need.pdf'
output_dir = '../examples/attention_is_all_you_need/'

pdf_path = '../examples/rh.pdf'
output_dir = '../examples/rh/'

# 清空output_dir
import shutil
shutil.rmtree(output_dir, ignore_errors=True)
Expand All @@ -24,13 +27,13 @@ def test_use_api_key():

def test_use_env():
from gptpdf import parse_pdf

# Use OPENAI_API_KEY and OPENAI_API_BASE from environment variables
content, image_paths = parse_pdf(pdf_path, output_dir=output_dir, model='gpt-4o', verbose=True)
print(content)
print(image_paths)
# also output_dir/output.md is generated


def test_azure():
from gptpdf import parse_pdf
api_key = '8ef0b4df45e444079cd5a4xxxxx' # Azure API Key
Expand Down

0 comments on commit 8a21c8f

Please sign in to comment.