Skip to content

Commit

Permalink
use matrix runner, fix tempfile mode
Browse files Browse the repository at this point in the history
  • Loading branch information
iammosespaulr committed Dec 10, 2024
1 parent 2bc4a14 commit 90cd334
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
29 changes: 5 additions & 24 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,11 @@ env:
TORCH_DEVICE: "cpu"

jobs:
build-ubuntu:
name: Build on Ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Install Python dependencies
run: |
pip install poetry
poetry install
- name: Run detection benchmark test
run: |
poetry run python benchmark.py --max 5 --result_path results --pdftext_only
poetry run python scripts/verify_benchmark_scores.py results/results.json
build-windows:
name: Build on Windows
runs-on: windows-latest
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest-large]
steps:
- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def main():
row = dataset[i]
pdf = row["pdf"]
tool_pages = {}
with tempfile.NamedTemporaryFile(suffix=".pdf") as f:
with tempfile.NamedTemporaryFile(suffix=".pdf", mode='w') as f:
f.write(pdf)
f.seek(0)
pdf_path = f.name
Expand Down

0 comments on commit 90cd334

Please sign in to comment.