30 lines
628 B
Python
30 lines
628 B
Python
|
|
"""
|
||
|
|
PyInstaller hook for PaddleOCR
|
||
|
|
|
||
|
|
Prevents PyInstaller from trying to bundle PaddleOCR and its dependencies.
|
||
|
|
These will be installed dynamically at runtime.
|
||
|
|
"""
|
||
|
|
|
||
|
|
from PyInstaller.utils.hooks import is_module_satisfies
|
||
|
|
|
||
|
|
# Tell PyInstaller to NOT collect these modules
|
||
|
|
# They will be installed at runtime via ensure_paddleocr()
|
||
|
|
|
||
|
|
hiddenimports = []
|
||
|
|
|
||
|
|
# Explicitly exclude heavy ML dependencies
|
||
|
|
excludedimports = [
|
||
|
|
'torch',
|
||
|
|
'transformers',
|
||
|
|
'tensorflow',
|
||
|
|
'onnx',
|
||
|
|
'onnxruntime',
|
||
|
|
'sentencepiece',
|
||
|
|
'tokenizers',
|
||
|
|
'diffusers',
|
||
|
|
'accelerate',
|
||
|
|
'datasets',
|
||
|
|
'huggingface_hub',
|
||
|
|
'safetensors',
|
||
|
|
]
|