fix: include torchcodec metadata in PyInstaller Windows build

transformers 5.x calls importlib.metadata.version("torchcodec") at import
time; without the metadata the frozen Windows app crashes on startup.
This commit is contained in:
Robrecht Siera 2026-08-05 12:17:26 +02:00
parent 3fa37a9d52
commit 72fee65028

View file

@ -35,6 +35,10 @@ datas += copy_metadata("treetable")
datas += copy_metadata("soundfile")
datas += copy_metadata("dora-search")
datas += copy_metadata("lhotse")
# transformers 5.x audio_utils calls importlib.metadata.version("torchcodec")
# at import time when AutoProcessor loads; without this the frozen Windows
# build crashes on startup with PackageNotFoundError.
datas += copy_metadata("torchcodec")
# Allow transformers package to load __init__.py file dynamically:
# https://github.com/chidiwilliams/buzz/issues/272