chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
name: Unit tests
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [t4_gpu, ubuntu-latest, windows-latest]
|
||||
fail-fast: false
|
||||
env:
|
||||
# T4 can't run bf16 in vllm; size for the 16GB card. (No-op on the
|
||||
# CPU runners, which skip the VLM-backed tests.)
|
||||
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: Run tests
|
||||
run: uv run pytest
|
||||
@@ -0,0 +1,32 @@
|
||||
name: "Surya CLA Assistant"
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
pull_request_target:
|
||||
types: [opened,closed,synchronize]
|
||||
|
||||
# explicitly configure permissions, in case your GITHUB_TOKEN workflow permissions are set to read-only in repository settings
|
||||
permissions:
|
||||
actions: write
|
||||
contents: write
|
||||
pull-requests: write
|
||||
statuses: write
|
||||
|
||||
jobs:
|
||||
CLAAssistant:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Surya CLA Assistant"
|
||||
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
|
||||
uses: contributor-assistant/github-action@v2.3.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# the below token should have repo scope and must be manually added by you in the repository's secret
|
||||
# This token is required only if you have configured to store the signatures in a remote repository/organization
|
||||
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
||||
with:
|
||||
path-to-signatures: 'signatures/version1/cla.json'
|
||||
path-to-document: 'https://github.com/datalab-to/surya/blob/master/CLA.md'
|
||||
# branch should not be protected
|
||||
branch: 'master'
|
||||
allowlist: VikParuchuri
|
||||
@@ -0,0 +1,23 @@
|
||||
name: Python package
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*.*.*"
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
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: Build package
|
||||
run: uv build
|
||||
- name: Publish package
|
||||
env:
|
||||
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
||||
run: uv publish
|
||||
@@ -0,0 +1,40 @@
|
||||
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
|
||||
Reference in New Issue
Block a user