pin torchaudio with torch, and say why an import failed

The pinned install succeeded — torch 2.5.1+cu124, parler_tts 0.2.2,
transformers 4.46.1 — and `import parler_tts` still failed, with the worker
reporting only

    parler-tts install did not yield an importable package

which names neither the package nor the reason. It now reports the import
error itself.

The reason pip left behind: parler-tts pulls in descript-audiotools, which
requires an unpinned torchaudio, and pip resolved 2.11.0 against torch 2.5.1.
torchaudio is pinned with torch now, in the file and in the inline pins — a
pair of versions that must match is not something to leave to a resolver.
Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014T3rZozi1Ehk96NG1WesgC
parent f7836901
......@@ -16,7 +16,7 @@
# Canonical product version for CoderAI — single source of truth. Both the API
# metadata and the admin web UI read from here.
__version__ = "0.5.20"
__version__ = "0.5.21"
__tagline__ = "Complete orchestration, distribution and escalation of remotizable advanced inference."
# Configure the CUDA caching allocator BEFORE torch is imported anywhere.
......
......@@ -36,6 +36,7 @@ _REQUIREMENTS = _REPO_ROOT / "requirements-parler.txt"
#: until the container is recreated). A test keeps the two in step.
_PINS = ("--extra-index-url", "https://download.pytorch.org/whl/cu124",
"torch==2.5.1+cu124",
"torchaudio==2.5.1+cu124",
"git+https://github.com/huggingface/parler-tts.git",
"soundfile>=0.12.0")
......@@ -55,12 +56,28 @@ def _venv_python() -> Path:
"python.exe" if os.name == "nt" else "python")
def _pip_ok(py: Path) -> bool:
def _import_check(py: Path) -> tuple:
"""``(ok, detail)`` for "are this venv's packages importable".
The detail matters. "install did not yield an importable package" is what
this used to say, which names neither the package nor the reason --
measured on zeiss, 2026-10-29, where the install had in fact succeeded and
the import was failing on a torchaudio that did not match the pinned
torch.
"""
try:
return venv_env.run([str(py), "-c", "import parler_tts, soundfile"],
capture_output=True).returncode == 0
except Exception:
return False
r = venv_env.run([str(py), "-c", "import parler_tts, soundfile"],
capture_output=True, text=True, timeout=600)
except Exception as exc:
return False, f"the import could not be run ({exc})"
if r.returncode == 0:
return True, ""
tail = ((r.stderr or "") or (r.stdout or "")).strip().splitlines()
return False, (tail[-1][:300] if tail else f"exit {r.returncode}")
def _pip_ok(py: Path) -> bool:
return _import_check(py)[0]
#: The op that failed. Parler's audio decoder (DAC) is convolutional, so a
......@@ -137,8 +154,11 @@ def _bootstrap_venv() -> Path:
venv_env.run([str(py), "-m", "pip", "install"]
+ venv_env.pip_install_args(_REQUIREMENTS, _PINS),
check=True)
if not _pip_ok(py):
raise RuntimeError("parler-tts install did not yield an importable package")
_imp, _why = _import_check(py)
if not _imp:
raise RuntimeError(
f"the parler-tts install finished but its packages do not "
f"import: {_why}")
_gpu, _why = _gpu_ok(py)
if not _gpu:
# Loud, and not fatal: a synthesis will fail with the real error
......
......@@ -21,6 +21,11 @@
--extra-index-url https://download.pytorch.org/whl/cu124
torch==2.5.1+cu124
# torchaudio has to be pinned WITH torch, not left to pip. parler-tts pulls in
# descript-audiotools, which requires an unpinned torchaudio: pip resolved
# 2.11.0 against torch 2.5.1, the install reported success, and `import
# parler_tts` then failed on the mismatch (measured on zeiss, 2026-10-29).
torchaudio==2.5.1+cu124
# parler-tts has no release on PyPI that carries the multilingual models, so it
# comes from the repo. It brings its own transformers pin with it; nothing here
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment