surya/.github/workflows/scripts.yml
Vik Paruchuri e966a20990
Some checks failed
Unit tests / build (t4_gpu) (push) Has been cancelled
Unit tests / build (ubuntu-latest) (push) Has been cancelled
Unit tests / build (windows-latest) (push) Has been cancelled
Test CLI scripts / build (push) Has been cancelled
CI fix
2026-05-27 10:59:19 -04:00

41 lines
1.6 KiB
YAML

name: Test CLI scripts
on: [push]
jobs:
build:
runs-on: t4_gpu
env:
# T4 (Turing, compute 7.5) can't run bf16 in vllm; size vllm for the 16GB
# card and give the cold start (image pull + model download) headroom.
VLLM_DTYPE: float16
VLLM_GPU_TYPE: t4
SURYA_INFERENCE_STARTUP_TIMEOUT: "1200"
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: latest
enable-cache: true
- name: Set up Python 3.11
run: uv python install 3.11
- name: Install dependencies
run: uv sync --frozen --group dev
- name: Download benchmark data
run: |
wget -O benchmark_data.zip "https://drive.google.com/uc?export=download&id=1NHrdYatR1rtqs2gPVfdvO0BAvocH8CJi"
unzip -o benchmark_data.zip
- name: Test detection
run: uv run surya_detect benchmark_data/pdfs/switch_trans.pdf --page_range 0
# Spawn the vllm server once and reuse it across the OCR/layout/table
# steps (--keep_server) instead of paying a cold start three times.
- name: Test OCR
run: uv run surya_ocr benchmark_data/pdfs/switch_trans.pdf --page_range 0 --keep_server
- name: Test layout
run: uv run surya_layout benchmark_data/pdfs/switch_trans.pdf --page_range 0 --keep_server
- name: Test table
run: uv run surya_table benchmark_data/pdfs/switch_trans.pdf --page_range 0 --keep_server
- name: Test detection folder
run: uv run surya_detect benchmark_data/pdfs --page_range 0