Fix sidecar crash: torch circular import under PyInstaller
- Exclude ctranslate2.converters from PyInstaller bundle — these modules import torch at module level causing circular import crashes, and are only needed for model conversion (never used at runtime) - Defer all heavy ML imports to first handler call instead of startup, so the sidecar can send its ready message without loading torch/whisper Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -33,7 +33,13 @@ a = Analysis(
|
||||
hookspath=[],
|
||||
hooksconfig={},
|
||||
runtime_hooks=[],
|
||||
excludes=["tkinter", "test", "unittest", "pip", "setuptools"],
|
||||
excludes=[
|
||||
"tkinter", "test", "unittest", "pip", "setuptools",
|
||||
# ctranslate2.converters imports torch at module level and causes
|
||||
# circular import crashes under PyInstaller. These modules are only
|
||||
# needed for model format conversion, never for inference.
|
||||
"ctranslate2.converters",
|
||||
],
|
||||
win_no_prefer_redirects=False,
|
||||
win_private_assemblies=False,
|
||||
cipher=block_cipher,
|
||||
|
||||
Reference in New Issue
Block a user