Spaces:
Sleeping
Pre-install the full NeMo [tts] dep graph at build time
Browse filesStop playing ImportError whack-a-mole. The --no-deps nemo install was
discovering NeMo's ~40 transitive deps one missing module at a time
(regex, tokenizers, matplotlib, seaborn, …). Now every dep NeMo's
[tts] extra needs — minus the one conflicting `transformers<=4.52`
pin — is pre-installed at build time, so installing nemo-toolkit
itself with --no-deps at runtime doesn't miss anything.
Complete list sourced from pypi.org/pypi/nemo-toolkit/2.4.0/json
(the `tts` extra): librosa, soundfile, omegaconf<=2.3, webdataset,
pandas, matplotlib, seaborn, einops, kornia, lhotse, lightning,
peft, torchmetrics, datasets, hydra-core<=1.3.2, nltk, janome,
jieba, pypinyin, mediapy==1.1.6, sentencepiece<1.0.0,
sacremoses, texterrors<1.0.0, jiwer, pydub, pyloudnorm, resampy,
pyannote.core, pyannote.metrics, optuna, marshmallow, fiddle,
cloudpickle, wandb, cdifflib, attrdict, braceexpand, kaldi-python-io,
whisper_normalizer, num2words, inflect, numba, ruamel.yaml,
scikit-learn, tensorboard, onnx, protobuf~=5.29.5, setuptools>=70.0.0,
python-dateutil, text-unidecode, wrapt, wget, tqdm, packaging,
fsspec==2024.12.0, scipy, plus transformers 5.x's own regex +
tokenizers>=0.22.0,<=0.23.0.
Co-Authored-By: Claude <noreply@anthropic.com>
Files changed (2)
- create_env.py+11-7
- requirements.txt+68-24
10 unmodified lines1112131415161718192021222324252627282910 unmodified lines``nemo-toolkit[tts]==2.4.0`` pulls in ``transformers<=4.52`` (whichresolves to 4.51.x), and that requires ``huggingface-hub<1.0`` —conflicting with gradio 6.20's ``huggingface-hub>=1.2`` at build timeso pip refuses to resolve. We install NeMo at runtime instead, afterpinning hub and transformers to the versions we want.Order is load-bearing:1. transformers==5.3.0 with --no-deps — forces the runtime onto theQwen3.5 backbone version the Gepard checkpoint was trained on.Pulls in hub>=1.2 transitively, satisfying gradio 6.20.2. nemo-toolkit[tts]==2.4.0 with --no-deps — installed on top oftransformers 5.3.0 without re-resolving its declared (conflicting)transformers<=4.52 constraint. The codec only needsnemo.collections.tts.models.AudioCodecModel; the missingtransformers<5.x import paths NeMo *might* check for aren'texercised at inference.3. numpy<2.0 — keep the NeMo/codec stack on numpy 1.x.Idempotent: writes a sentinel file so the install only runs once per10 unmodified lines111213141516171819202122232425262728293031323310 unmodified lines``nemo-toolkit[tts]==2.4.0`` pulls in ``transformers<=4.52`` (whichresolves to 4.51.x), and that requires ``huggingface-hub<1.0`` —conflicting with gradio 6.20's ``huggingface-hub>=1.2`` at build timeso pip refuses to resolve. We install nemo-toolkit itself at runtimewith ``--no-deps`` instead.All of NeMo's OTHER [tts] dependencies (librosa, soundfile, omegaconf,matplotlib, seaborn, einops, kornia, lhotse, lightning, peft,torchmetrics, datasets, …) are pre-installed at build time fromrequirements.txt — the complete list minus the conflictingtransformers pin (source: pypi.org/pypi/nemo-toolkit/2.4.0/json).So installing nemo with --no-deps doesn't miss anything import-time.Order is load-bearing:1. transformers==5.3.0 with --no-deps — forces the runtime onto theQwen3.5 backbone version the Gepard checkpoint was trained on.Combined with the pre-installed hub>=1.2, satisfies gradio 6.20.2. nemo-toolkit[tts]==2.4.0 with --no-deps — installed on top oftransformers 5.3.0 without re-resolving its declared (conflicting)transformers<=4.52 constraint.3. numpy<2.0 — keep the NeMo/codec stack on numpy 1.x.Idempotent: writes a sentinel file so the install only runs once per
3 unmodified lines45678910111213141516171819202122232425262728293031323334353637383 unmodified lines# gradio is pinned via sdk_version in README.md (the Dockerfile installs it# with the [oauth,mcp] extras). Don't re-pin it here.## nemo-toolkit[tts]==2.4.0 is installed in create_env.py at runtime instead# of here, because its `transformers<=4.52` constraint pulls in transformers# 4.51.x which requires huggingface-hub<1.0 — conflicting with gradio 6.20's# hub>=1.2 requirement at build time. create_env.py pins transformers==5.3.0# + hub>=1.2 first (with --no-deps), then installs nemo with --no-deps.# The deps listed below cover NeMo's runtime imports (nemo.collections.tts# only needs torch + omegaconf at import time, plus a few small libs).safetensorslibrosa>=0.10.0soundfilepyyamlnumpy<2.0scipy# NeMo runtime deps (not installed by `pip install nemo-toolkit[tts]` since# we use --no-deps to keep gradio 6.20's hub constraint resolvable).omegaconfwebdatasetpandastqdmwgetinflectnum2wordssentencepieceeditdistancehydra-corepackagingmatplotlib# transformers 5.x runtime imports not pulled by --no-deps nemo.# tokenizers is pinned to transformers 5.3.0's accepted range# (>=0.22.0,<=0.23.0); 0.23.1 fails the version check.regextokenizers>=0.22.0,<=0.23.03 unmodified lines456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081823 unmodified lines# gradio is pinned via sdk_version in README.md (the Dockerfile installs it# with the [oauth,mcp] extras). Don't re-pin it here.## Why does nemo-toolkit[tts]==2.4.0 itself NOT appear here? Its# `transformers<=4.52,>=4.51` constraint pulls in transformers 4.51.x which# requires huggingface-hub<1.0 — conflicting with gradio 6.20's# hub>=1.2 at build-time resolution. Install nemo itself in create_env.py# with `--no-deps` at runtime, AFTER pinning transformers==5.3.0.## Everything ELSE NeMo's [tts] extra needs IS listed below, pre-installed# at build time — this is the full nemo-toolkit[tts]==2.4.0 dependency# graph minus nemo-toolkit itself and the conflicting `transformers` pin.# That avoids the ImportError whack-a-mole that `--no-deps` nemo caused.# (Source: pypi.org/pypi/nemo-toolkit/2.4.0/json, `tts` extra.)safetensorslibrosa>=0.10.1soundfilepyyamlnumpy<2.0scipy>=0.14ruamel.yamlomegaconf<=2.3webdataset>=0.2.86pandastqdm>=4.41.0wgetwraptnumbafsspec==2024.12.0python-dateutiltext-unidecodescikit-learntensorboardonnx>=1.7.0protobuf~=5.29.5setuptools>=70.0.0einopskorniamatplotlibseabornjanomejiebapypinyinpypinyin-dictattrdictcdifflib==1.2.6nltkbraceexpandjiwer<4.0.0,>=3.1.0kaldi-python-iolhotse!=1.31.0marshmallowoptunapackagingpyannote.corepyannote.metricspydubpyloudnormresampytexterrors<1.0.0whisper_normalizernum2wordsinflectmediapy==1.1.6sacremoses>=0.0.43sentencepiece<1.0.0cloudpicklefiddlehydra-core<=1.3.2,>1.3lightning<=2.4.0,>2.2.1pefttorchmetrics>=0.11.0wandbdatasets# transformers 5.x runtime imports (transformers itself is installed at# runtime in create_env.py due to the NeMo conflict above; these are its# runtime deps that --no-deps skips).regextokenizers>=0.22.0,<=0.23.0 # pinned to transformers 5.3.0's accepted range