-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
103 lines (92 loc) · 3.95 KB
/
Copy pathpyproject.toml
File metadata and controls
103 lines (92 loc) · 3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
[build-system]
requires = ["setuptools>=68"]
build-backend = "setuptools.build_meta"
[project]
name = "hunyuan-ocr"
version = "0.1.3"
description = "Evaluation-backed AMD ROCm port of HunyuanOCR-1.5 for OmniDocBench v1.6"
readme = "README.md"
requires-python = ">=3.11"
# Mixed license: see NOTICE and LICENSES/. Original packaging/tooling is Apache-2.0;
# code ported from HunyuanOCR and the model weights are under the Tencent Hunyuan
# Community License (not OSI open source; excludes EU/UK/KR).
license = { text = "Mixed: Apache-2.0 (original packaging/tooling) AND Tencent Hunyuan Community License (code ported from HunyuanOCR + model weights). See NOTICE and LICENSES/." }
authors = [{ name = "AIwork4me" }]
keywords = [
"hunyuanocr", "ocr", "document-ai", "amd-gpu", "rocm", "rdna3",
"llama-cpp", "vllm", "omnidocbench", "vision-language-model",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
# Core deps are intentionally GPU-free: importing the package, validating,
# scoring-wrapper config, and the CLI all work on a plain CPU. The heavy / GPU
# deps are opt-in extras. Plain-PyPI torch is NEVER a dependency — on ROCm you
# must install torch from a verified ROCm wheel source separately (see README).
dependencies = [
"pillow",
"pyyaml",
"tqdm",
"requests",
]
[project.optional-dependencies]
# OpenAI-compatible client (vLLM / llama-server / any OAI server).
client = ["openai>=1.0"]
# Hugging Face model/artifact downloader (provides the `hf` CLI used in Quick Start).
download = ["huggingface_hub>=0.25"]
# transformers backend (Phase 1 oracle). Pinned to the benchmark version for
# reproducibility; see reproducibility.lock.yaml. Requires a separate ROCm torch.
transformers = ["transformers==5.13.0"]
# Convenience alias; pyyaml is already core. Reserved for future eval-only deps.
eval = ["pyyaml"]
# OmniDocBench-ROCm platform integration (conformance, score, publish).
platform = ["omnidocbench-rocm>=0.2.0"]
# Development / CI tooling.
dev = ["pytest>=8", "pytest-mock", "ruff>=0.16,<0.17", "build", "pytest-cov>=4"]
[project.urls]
Homepage = "https://github.com/AIwork4me/HunyuanOCR-ROCm"
Repository = "https://github.com/AIwork4me/HunyuanOCR-ROCm"
Issues = "https://github.com/AIwork4me/HunyuanOCR-ROCm/issues"
[project.scripts]
hunyuan-ocr = "hunyuan_ocr.cli:main"
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
hunyuan_ocr = ["data/*.yaml"]
[tool.ruff]
line-length = 120
target-version = "py311"
extend-exclude = ["REPRO.yaml", "reproduce.md"]
[tool.ruff.lint]
# The eval pipeline is defensive by design: per-page failures are caught and the
# run continues (never raises — see the adapter contract). Broad blind-except
# (BLE001) and silent try/except/pass (S110) are intentional, not bugs.
ignore = ["BLE001", "S110"]
[tool.ruff.lint.per-file-ignores]
# Vendored / verbatim upstream-derived algorithm files: lint only, never reformat,
# so diffs against Tencent HunyuanOCR stay trackable. The multi-statement (E701/
# E702) and import-layout (E401) styles and the placeholder f-string (F541) are
# preserved verbatim from upstream on purpose.
"src/hunyuan_ocr/postprocess.py" = ["E501", "E741", "E701", "E702", "E401", "F541"]
"src/hunyuan_ocr/tasks.py" = ["E501"]
"src/hunyuan_ocr/contract.py" = ["E501"]
[tool.ruff.format]
# per-file-ignores is lint-only; the formatter must exclude the same vendored
# files explicitly so `ruff format` never rewrites them.
exclude = [
"src/hunyuan_ocr/postprocess.py",
"src/hunyuan_ocr/tasks.py",
"src/hunyuan_ocr/contract.py",
]
[tool.pytest.ini_options]
testpaths = ["tests"]
markers = [
"gpu: end-to-end test requiring a real gfx1100 ROCm GPU + model weights (deselected in CI)",
]