Skip to content

fix(dev): add setup script for chatterbox-tts and hume-tada installation#543

Open
delta97 wants to merge 1 commit intojamiepine:mainfrom
delta97:fix/chatterbox-module-not-found
Open

fix(dev): add setup script for chatterbox-tts and hume-tada installation#543
delta97 wants to merge 1 commit intojamiepine:mainfrom
delta97:fix/chatterbox-module-not-found

Conversation

@delta97
Copy link
Copy Markdown

@delta97 delta97 commented Apr 24, 2026

Summary

  • Add scripts/setup-backend.sh that mirrors the Dockerfile's Python setup for local development
  • Update requirements.txt comments to document the manual --no-deps install commands

Problem

Local development was missing the pip install --no-deps chatterbox-tts and pip install --no-deps hume-tada steps that the Dockerfile includes (lines 38-39). This caused ModuleNotFoundError: No module named 'chatterbox' errors when trying to use the Chatterbox TTS model.

The --no-deps flag is required because these packages pin incompatible versions:

  • chatterbox-tts: pins numpy<1.26, torch==2.6.0, transformers==4.46.3
  • hume-tada: pins torch>=2.7,<2.8

Test plan

  • Run ./scripts/setup-backend.sh in a fresh venv
  • Verify python -c "import chatterbox" succeeds
  • Verify Chatterbox model can be downloaded and used in the UI

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Added a setup script (scripts/setup-backend.sh) to streamline backend installation and dependency resolution for TTS packages.
  • Documentation

    • Updated installation guidance in requirements documentation to address dependency conflicts for TTS integrations and provide clear setup instructions.

Local development was missing the `pip install --no-deps chatterbox-tts`
and `pip install --no-deps hume-tada` steps that the Dockerfile includes.
This caused "No module named 'chatterbox'" errors when trying to use the
Chatterbox TTS model.

- Add scripts/setup-backend.sh that mirrors the Dockerfile's Python setup
- Update requirements.txt comments to document the manual install commands

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 24, 2026

📝 Walkthrough

Walkthrough

The changes update installation guidance in requirements documentation and introduce a new bash setup script to automate backend dependency installation while handling packages with incompatible pinned dependencies using the --no-deps flag.

Changes

Cohort / File(s) Summary
Requirements Documentation
backend/requirements.txt
Updated comments clarifying installation instructions for chatterbox-tts and hume-tada, recommending use of the new setup script or pip install --no-deps to resolve version incompatibilities.
Backend Setup Script
scripts/setup-backend.sh
New bash script that automates backend setup by installing dependencies from backend/requirements.txt and separately installing chatterbox-tts and hume-tada with --no-deps to bypass conflicting pinned dependencies.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A script to tame the dependency dance,
Where pip and torch needed a second chance,
With --no-deps we sidestep the fight,
Backend setup now runs just right! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a setup script for installing chatterbox-tts and hume-tada dependencies with --no-deps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
scripts/setup-backend.sh (3)

13-13: Consider using python -m pip for better portability.

Using python -m pip instead of the bare pip command ensures the package manager matches the active Python interpreter, which is more reliable in environments with multiple Python versions.

♻️ Proposed fix
-pip install -r "$PROJECT_DIR/backend/requirements.txt"
+python -m pip install -r "$PROJECT_DIR/backend/requirements.txt"

Apply the same change to lines 17-18:

-pip install --no-deps chatterbox-tts
-pip install --no-deps hume-tada
+python -m pip install --no-deps chatterbox-tts
+python -m pip install --no-deps hume-tada
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/setup-backend.sh` at line 13, Replace bare pip invocations in the
setup script with the interpreter-bound form to ensure the pip used matches the
active Python: change the pip install lines (the call currently shown as "pip
install -r \"$PROJECT_DIR/backend/requirements.txt\"") to use "python -m pip"
and apply the same replacement to the other pip lines around that block (the
other pip install commands referenced on lines 17–18) so all package installs
use the active Python interpreter's pip.

17-18: Consider pinning versions for chatterbox-tts and hume-tada.

While the --no-deps approach correctly avoids dependency conflicts, installing these packages without version pins could lead to unexpected breakage if their APIs change in future releases. Consider adding version constraints to ensure reproducible builds.

♻️ Suggested approach

First, determine the current working versions, then pin them:

-pip install --no-deps chatterbox-tts
-pip install --no-deps hume-tada
+python -m pip install --no-deps chatterbox-tts==<version>
+python -m pip install --no-deps hume-tada==<version>

You may also want to add corresponding comments in requirements.txt to document the pinned versions.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/setup-backend.sh` around lines 17 - 18, Pin the package versions for
the two installs to ensure reproducible builds: replace the existing pip install
commands (the lines installing "chatterbox-tts" and "hume-tada") with
version-pinned installs (e.g., chatterbox-tts==<current-version> and
hume-tada==<current-version>) after determining the current working versions,
and add matching comments or entries in requirements.txt documenting those
pinned versions and why --no-deps is used; update the two pip install
invocations in scripts/setup-backend.sh and add corresponding notes in
requirements.txt.

5-20: Optional: Add virtual environment check and better user feedback.

The script could benefit from checking that it's running in a virtual environment to prevent accidentally polluting the system Python installation. Additionally, providing more detailed progress messages would improve the user experience.

💡 Example enhancements
 set -e
 
+# Check if running in a virtual environment
+if [[ -z "${VIRTUAL_ENV}" ]]; then
+  echo "Warning: Not running in a virtual environment."
+  echo "Consider creating one with: python -m venv venv && source venv/bin/activate"
+  read -p "Continue anyway? (y/N) " -n 1 -r
+  echo
+  if [[ ! $REPLY =~ ^[Yy]$ ]]; then
+    exit 1
+  fi
+fi
+
 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
 
-echo "Installing backend dependencies..."
+echo "==> Installing backend dependencies..."
 
 # Install main requirements
-pip install -r "$PROJECT_DIR/backend/requirements.txt"
+echo "==> Installing requirements from requirements.txt..."
+python -m pip install -r "$PROJECT_DIR/backend/requirements.txt"
 
 # Install packages that need --no-deps due to incompatible pinned versions
 # (See comments in requirements.txt for details)
-pip install --no-deps chatterbox-tts
-pip install --no-deps hume-tada
+echo "==> Installing chatterbox-tts (--no-deps)..."
+python -m pip install --no-deps chatterbox-tts
+echo "==> Installing hume-tada (--no-deps)..."
+python -m pip install --no-deps hume-tada
 
-echo "Backend setup complete!"
+echo "==> Backend setup complete!"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/setup-backend.sh` around lines 5 - 20, Add a virtual environment
check at the top of the script by testing common indicators (e.g., the
VIRTUAL_ENV environment variable or comparing "$(python -c 'import sys;
print(sys.prefix)')" to system prefixes) and exit with a clear message if no
venv is active; then add concise progress/log messages around key steps (e.g.,
"Checking virtualenv...", "Installing backend dependencies from
$PROJECT_DIR/backend/requirements.txt", "Installing chatterbox-tts (no deps)",
"Installing hume-tada (no deps)", "Backend setup complete") to improve user
feedback; update references in the script to use the existing SCRIPT_DIR and
PROJECT_DIR variables when composing messages.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@backend/requirements.txt`:
- Around line 24-27: Update the chatterbox-tts explanatory comment to reflect
the correct conditional dependency pins and Python version thresholds: replace
the outdated "numpy<1.26 / torch==2.6 which conflict with Python 3.12+" text
with a concise note that chatterbox-tts v0.1.7 pins numpy>=1.24.0,<2.0.0 for
Python <3.13 and numpy>=2.0.0 for Python >=3.13, and pins torch==2.6.0 for
Python <3.14 and torch>=2.9.0 for Python >=3.14, and state that conflicts occur
starting at Python 3.13 (numpy) and Python 3.14 (torch); keep the surrounding
guidance about installing chatterbox-tts with --no-deps intact.

---

Nitpick comments:
In `@scripts/setup-backend.sh`:
- Line 13: Replace bare pip invocations in the setup script with the
interpreter-bound form to ensure the pip used matches the active Python: change
the pip install lines (the call currently shown as "pip install -r
\"$PROJECT_DIR/backend/requirements.txt\"") to use "python -m pip" and apply the
same replacement to the other pip lines around that block (the other pip install
commands referenced on lines 17–18) so all package installs use the active
Python interpreter's pip.
- Around line 17-18: Pin the package versions for the two installs to ensure
reproducible builds: replace the existing pip install commands (the lines
installing "chatterbox-tts" and "hume-tada") with version-pinned installs (e.g.,
chatterbox-tts==<current-version> and hume-tada==<current-version>) after
determining the current working versions, and add matching comments or entries
in requirements.txt documenting those pinned versions and why --no-deps is used;
update the two pip install invocations in scripts/setup-backend.sh and add
corresponding notes in requirements.txt.
- Around line 5-20: Add a virtual environment check at the top of the script by
testing common indicators (e.g., the VIRTUAL_ENV environment variable or
comparing "$(python -c 'import sys; print(sys.prefix)')" to system prefixes) and
exit with a clear message if no venv is active; then add concise progress/log
messages around key steps (e.g., "Checking virtualenv...", "Installing backend
dependencies from $PROJECT_DIR/backend/requirements.txt", "Installing
chatterbox-tts (no deps)", "Installing hume-tada (no deps)", "Backend setup
complete") to improve user feedback; update references in the script to use the
existing SCRIPT_DIR and PROJECT_DIR variables when composing messages.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7a1ec75e-719b-4ee3-a498-e607f31e1688

📥 Commits

Reviewing files that changed from the base of the PR and between ed2eec5 and c7454a5.

📒 Files selected for processing (2)
  • backend/requirements.txt
  • scripts/setup-backend.sh

Comment thread backend/requirements.txt
Comment on lines +24 to +27
# Chatterbox TTS sub-dependencies (chatterbox-tts itself must be installed
# with --no-deps — run scripts/setup-backend.sh or:
# pip install --no-deps chatterbox-tts
# It pins numpy<1.26 / torch==2.6 which conflict with Python 3.12+)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

What are the exact dependency version pins in the chatterbox-tts Python package, specifically for numpy and torch?

💡 Result:

The chatterbox-tts Python package (latest version 0.1.7) specifies conditional dependency version pins for numpy and torch in its pyproject.toml file to support different Python versions: For numpy: - numpy>=1.24.0,<2.0.0 when python_version < '3.13' - numpy>=2.0.0 when python_version >= '3.13' For torch (and torchaudio): - torch==2.6.0 and torchaudio==2.6.0 when python_version < '3.14' - torch>=2.9.0 and torchaudio>=2.9.0 when python_version >= '3.14' These are not exact single-version pins but ranges and exact versions conditioned on the Python version for compatibility (e.g., wheel availability). Older versions had stricter pins like numpy==1.26.0 or <1.26.0,>=1.24.0, but the current master/main branch reflects the above.

Citations:


Update the chatterbox-tts comment with accurate dependency version constraints.

The documented version constraints are outdated. Chatterbox-tts v0.1.7 uses conditional pins based on Python version: numpy>=1.24.0,<2.0.0 (Python < 3.13), numpy>=2.0.0 (Python >= 3.13), torch==2.6.0 (Python < 3.14), and torch>=2.9.0 (Python >= 3.14). The conflict is with Python 3.13+ for numpy and Python 3.14+ for torch, not Python 3.12+. Update the comment to reflect these conditional constraints and correct Python version thresholds.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@backend/requirements.txt` around lines 24 - 27, Update the chatterbox-tts
explanatory comment to reflect the correct conditional dependency pins and
Python version thresholds: replace the outdated "numpy<1.26 / torch==2.6 which
conflict with Python 3.12+" text with a concise note that chatterbox-tts v0.1.7
pins numpy>=1.24.0,<2.0.0 for Python <3.13 and numpy>=2.0.0 for Python >=3.13,
and pins torch==2.6.0 for Python <3.14 and torch>=2.9.0 for Python >=3.14, and
state that conflicts occur starting at Python 3.13 (numpy) and Python 3.14
(torch); keep the surrounding guidance about installing chatterbox-tts with
--no-deps intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant