mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: make OCR portable and reliable across AMD64 and ARM64 (#519)
* fix: make OCR portable and reliable * fix: harden OCR installation portability * fix: pin OCR partials across downloads * fix: make OCR execution reliably asynchronous * fix: harden OCR portability and docs routes * fix: preserve decoder and docs safeguards
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
"""Accurate OCR must never re-enter the mutable legacy Python dispatcher."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from packages.ai.python import dispatcher
|
||||
|
||||
|
||||
def test_legacy_dispatcher_does_not_allow_ocr_scripts():
|
||||
assert "ocr" not in dispatcher.ALLOWED_SCRIPTS
|
||||
assert "ocr_pdf" not in dispatcher.ALLOWED_SCRIPTS
|
||||
|
||||
|
||||
def test_shared_requirements_do_not_install_paddle():
|
||||
python_root = Path(__file__).resolve().parents[1]
|
||||
for name in ("requirements.txt", "requirements-gpu.txt"):
|
||||
requirements = (python_root / name).read_text(encoding="utf-8").lower()
|
||||
assert "paddleocr" not in requirements
|
||||
assert "paddlepaddle" not in requirements
|
||||
Reference in New Issue
Block a user