Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
98845ca
* Added route to upload sample into speakers folder, so you can uploa…
Jun 11, 2024
9f783f6
Merge pull request #1 from daswer123/main
abeiro Sep 2, 2024
1e7a025
* Added XTTSv2_AIFF.ipynb
abeiro Sep 12, 2024
47d3568
Merge branch 'main' of https://github.com/abeiro/xtts-api-server
abeiro Sep 12, 2024
571c4f2
* Added default Narrator voice
abeiro Nov 26, 2024
f10207f
* Fixed versions to avoid future breakages
abeiro Jan 8, 2025
5e310e0
* Added ddistro files
May 6, 2025
65dfd1c
word changs for install
RANGROO May 10, 2025
f720b33
CHIM XTTS install conf.sh
RANGROO May 10, 2025
0e9f827
standarized conf.sh
RANGROO May 10, 2025
e7faea6
fix typo
RANGROO May 10, 2025
c9e67cf
Update ddistro_install.sh
abeiro May 13, 2025
f1e8c39
Update ddistro_install.sh
abeiro May 13, 2025
c388e1d
Added CUDA 12.8 to PATH if exists
abeiro May 16, 2025
38f8dfa
tourchcodec added
RANGROO Aug 23, 2025
2570806
pytorch download changes
RANGROO Aug 23, 2025
dd9c688
path fixes
RANGROO Aug 23, 2025
19a1f69
Update ddistro_install.sh
abeiro Aug 27, 2025
c5de028
update instructions for xtts install
RANGROO Aug 31, 2025
1d412ea
typo fix
RANGROO Aug 31, 2025
5c1a35f
Specify PyTorch and related package versions (2.7.0)
abeiro Oct 16, 2025
241dd37
Enhance CUDA installation process in ddistro_install.sh
abeiro Oct 17, 2025
ae57177
Create requirements5.txt with project dependencies
abeiro Oct 17, 2025
bf46de0
Add LD_LIBRARY_PATH for DeepSpeed execution
abeiro Oct 17, 2025
f51038b
Add LD_LIBRARY_PATH for NVIDIA libraries
abeiro Oct 17, 2025
0218c48
Set LD_LIBRARY_PATH for Python TTS
abeiro Oct 17, 2025
b8a1ca0
Chnaged deepspeed version to 0.18.1
abeiro Oct 27, 2025
05b5812
Add conditional CUDA path setup in start-deepspeed.sh
abeiro Oct 28, 2025
5cf3f7e
Add NVIDIA CUDA 13 DEV packages to requirements
abeiro Oct 28, 2025
33efb27
Enhance ddistro_install.sh for CUDA setup
abeiro Oct 28, 2025
8164e94
Clean previous deepspeed cache before installation
abeiro Oct 28, 2025
6f08109
Remove nvidia-cuda-profiler-api-cu13 from requirements
abeiro Nov 2, 2025
9d47698
Implement clean install prompt in ddistro_install.sh
abeiro Nov 15, 2025
5897796
Terminate processes on port 8020 if running
abeiro Nov 15, 2025
561e6f0
Setup Python virtual environment on clean install
abeiro Nov 15, 2025
4662efc
Clarify deepseed option requirements in conf.sh
abeiro Dec 10, 2025
3060a1c
Add start-gpu.sh to set up and run the service
abeiro Jan 7, 2026
df041b4
* Deñeted wrong file
abeiro Jan 7, 2026
72770c6
install message
RANGROO Jan 9, 2026
4713e53
Merge branch 'main' of https://github.com/abeiro/xtts-api-server
RANGROO Jan 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
dist
venv
speakers
output
test
models
xtts_api_server/models
*.pyc
xtts_api_server/RealtimeTTS/engines/coqui_engine_old.py
xtts_models
modules-xtts.txt
modules-xtts.txt
116 changes: 116 additions & 0 deletions XTTSv2_AIFF.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"gpuType": "T4"
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"accelerator": "GPU"
},
"cells": [
{
"cell_type": "markdown",
"source": [
"**Run next block, restart session when asked and run same block until everything installs.**\n",
"\n",
"Last message should be like this (yes, ignore ERROR)\n",
"\n",
"\n",
"```\n",
"ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
"torchvision 0.19.0+cu121 requires torch==2.4.0, but you have torch 2.1.1+cu121 which is incompatible\n",
"Successfully installed torch-2.1.1+cu121 torchaudio-2.1.1+cu121 triton-2.1.0\n",
"\n",
"```\n",
"\n"
],
"metadata": {
"id": "FmMMJppi2-Gh"
}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "lT4ieCTnr_L7"
},
"outputs": [],
"source": [
"!apt-get update && apt-get install --no-install-recommends -y sox libsox-fmt-all curl wget gcc git git-lfs build-essential libaio-dev libsndfile1 ssh ffmpeg sshpass portaudio19-dev libportaudio2\n",
"!git clone https://github.com/abeiro/xtts-api-server\n",
"%cd xtts-api-server\n",
"!python3 -m pip install --upgrade pip wheel ninja virtualenv\n",
"!pip install setuptools==68.1.2\n",
"!pip install deepspeed\n",
"!pip install -r requirements.txt\n",
"!pip install torch==2.1.1+cu121 torchaudio==2.1.1+cu121 --index-url https://download.pytorch.org/whl/cu121"
]
},
{
"cell_type": "markdown",
"source": [
"**Run this once to get model downloaded and deepspeed compiled. Once uvicorn starts, stop and proceed to next block**\n",
"\n",
"\n",
"\n"
],
"metadata": {
"id": "u1Ir_s5U3ZcT"
}
},
{
"cell_type": "code",
"source": [
"!python3 -m xtts_api_server --listen --deepspeed"
],
"metadata": {
"id": "Xs5dXNL43VFB"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"**Run and note cloudflare address. Wait for message:**\n",
"\n",
"```\n",
"INFO: Uvicorn running on http://0.0.0.0:8020 (Press CTRL+C to quit)\n",
"\n",
"```\n",
"\n",
"Use http://generated-domain-name:80 in AI-FF conf.\n",
"\n"
],
"metadata": {
"id": "xOowr61z3nT2"
}
},
{
"cell_type": "code",
"source": [
"#Run\n",
"!rm nohup.out\n",
"!wget -c https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -O cloudflared-linux-amd64\n",
"!chmod +x cloudflared-linux-amd64\n",
"!nohup ./cloudflared-linux-amd64 tunnel --url http://localhost:8020 &\n",
"!sleep 8\n",
"!cat nohup.out\n",
"!python3 -m xtts_api_server --listen --deepspeed"
],
"metadata": {
"id": "xuLmVnEW2PYM"
},
"execution_count": null,
"outputs": []
}
]
}
67 changes: 67 additions & 0 deletions conf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash
clear
cat << EOF
CHIM XTTS

This will install CHIM XTTS. This is a high quality TTS service that works with Skyrim voices.
You can also generate your own voices.
However it will require around 4GB of VRAM!

Options:
* deepseed = Uses more VRAM but it is faster. Needs cuda13 for 50xx series GPUs.
* lowvram = Uses less VRAM but it is slower.
* regular = Middle ground of both options above. RECOMMENDED!

If you are not sure use lowvram.

EOF

if [ ! -d /home/dwemer/python-tts ]; then
exit "XTTSv2 not installed"
fi
Comment on lines +19 to +21
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

Fix invalid use of exit with a string.
exit only accepts numeric status codes. Use echo to print the message and then exit 1.

- if [ ! -d /home/dwemer/python-tts ]; then
-     exit "XTTSv2 not installed"
+ if [ ! -d /home/dwemer/python-tts ]; then
+     echo "Error: XTTSv2 not installed" >&2
+     exit 1
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if [ ! -d /home/dwemer/python-tts ]; then
exit "XTTSv2 not installed"
fi
if [ ! -d /home/dwemer/python-tts ]; then
echo "Error: XTTSv2 not installed" >&2
exit 1
fi
🧰 Tools
🪛 Shellcheck (0.10.0)

[error] 21-21: Can only exit with status 0-255. Other data should be written to stdout/stderr.

(SC2242)


mapfile -t files < <(find /home/dwemer/xtts-api-server/ -name "start-*.sh")
# Check if any files were found

if [ ${#files[@]} -eq 0 ]; then
echo "No files found matching the pattern."
exit 1
fi

# Display the files in a numbered list
echo -e "Select a an option from the list:\n\n"
for i in "${!files[@]}"; do
echo "$((i+1)). ${files[$i]}"
done

echo "0. Disable service";
echo

Comment on lines +31 to +39
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

Fix typos in user-facing text (“deepseed” → “deepspeed”; “Select a an” → “Select an”).

User-visible messages should be correct and professional.

-echo -e "Select a an option from the list:\n\n"
+echo -e "Select an option from the list:\n\n"
@@
-* deepseed = Uses more VRAM but faster
+* deepspeed = Uses more VRAM but faster
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Display the files in a numbered list
echo -e "Select a an option from the list:\n\n"
for i in "${!files[@]}"; do
echo "$((i+1)). ${files[$i]}"
done
echo "0. Disable service";
echo
# Display the files in a numbered list
echo -e "Select an option from the list:\n\n"
for i in "${!files[@]}"; do
echo "$((i+1)). ${files[$i]}"
done
echo "0. Disable service";
echo
🤖 Prompt for AI Agents
In conf.sh around lines 31 to 39, fix typos in user-facing strings: change
"Select a an option from the list:" to "Select an option from the list:" and
replace any occurrences of "deepseed" with the correct "deepspeed" in the file
so all displayed messages are spelled correctly and professional.

# Prompt the user to make a selection
read -p "Select an option by picking the matching number: " selection

# Validate the input

if [ "$selection" -eq "0" ]; then
echo "Disabling service. Run this again to enable"
rm /home/dwemer/xtts-api-server/start.sh &>/dev/null
exit 0
fi

if ! [[ "$selection" =~ ^[0-9]+$ ]] || [ "$selection" -lt 1 ] || [ "$selection" -gt ${#files[@]} ]; then
echo "Invalid selection."
exit 1
fi
Comment on lines +45 to +54
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.

🛠️ Refactor suggestion

Reorder input validation to prevent comparison errors
Using -eq on a non-numeric string will cause a runtime error. Check for numeric input first or use string comparison for the zero case. For example:

- if [ "$selection" -eq "0" ]; then
+ # Check for zero before numeric comparison
+ if [ "$selection" = "0" ]; then
     echo "Disabling service. Run this again to enable"
     rm /home/dwemer/xtts-api-server/start.sh &>/dev/null
     exit 0
  fi

- if ! [[ "$selection" =~ ^[0-9]+$ ]] || [ "$selection" -lt 1 ] || [ "$selection" -gt ${#files[@]} ]; then
+ if ! [[ "$selection" =~ ^[0-9]+$ ]] || [ "$selection" -lt 1 ] || [ "$selection" -gt ${#files[@]} ]; then
     echo "Invalid selection."
     exit 1
  fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if [ "$selection" -eq "0" ]; then
echo "Disabling service. Run this again to enable"
rm /home/dwemer/xtts-api-server/start.sh &>/dev/null
exit 0
fi
if ! [[ "$selection" =~ ^[0-9]+$ ]] || [ "$selection" -lt 1 ] || [ "$selection" -gt ${#files[@]} ]; then
echo "Invalid selection."
exit 1
fi
# Check for zero before numeric comparison
if [ "$selection" = "0" ]; then
echo "Disabling service. Run this again to enable"
rm /home/dwemer/xtts-api-server/start.sh &>/dev/null
exit 0
fi
if ! [[ "$selection" =~ ^[0-9]+$ ]] || [ "$selection" -lt 1 ] || [ "$selection" -gt ${#files[@]} ]; then
echo "Invalid selection."
exit 1
fi


# Get the selected file
selected_file="${files[$((selection-1))]}"

echo "You selected: $selected_file"

ln -sf $selected_file /home/dwemer/xtts-api-server/start.sh
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.

🛠️ Refactor suggestion

Quote path variables in ln -sf
Always quote expansions to handle paths containing spaces or special characters:

- ln -sf $selected_file /home/dwemer/xtts-api-server/start.sh
+ ln -sf "$selected_file" "/home/dwemer/xtts-api-server/start.sh"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ln -sf $selected_file /home/dwemer/xtts-api-server/start.sh
ln -sf "$selected_file" "/home/dwemer/xtts-api-server/start.sh"



# Ensure all start scripts are executable
chmod +x /home/dwemer/xtts-api-server/start-*.sh 2>/dev/null || true


128 changes: 128 additions & 0 deletions ddistro_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
#!/bin/bash

echo "=== CHIM XTTS Installation ==="
echo ""
echo "NOTE: CHIM XTTS and Chatterbox use the same port (8020)."
echo " Only one can be enabled at a time."
echo ""

cd /home/dwemer/xtts-api-server
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.

🛠️ Refactor suggestion

Ensure cd command is checked.
If the directory change fails, the rest of the script will run in the wrong context. Wrap it with an exit on failure:

- cd /home/dwemer/xtts-api-server
+ cd /home/dwemer/xtts-api-server || { echo "Error: cannot cd to xtts-api-server"; exit 1; }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cd /home/dwemer/xtts-api-server
cd /home/dwemer/xtts-api-server || { echo "Error: cannot cd to xtts-api-server"; exit 1; }
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 2-2: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

Comment on lines +2 to +9
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.

🛠️ Refactor suggestion

Add shebang and strict error handling.
There is no shebang at the top, and failures won't be caught. Prepend these lines:

+ #!/bin/bash
+ set -euo pipefail
🧰 Tools
🪛 Shellcheck (0.10.0)

[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

(SC2148)


[warning] 2-2: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

python3 -m venv /home/dwemer/python-tts
source /home/dwemer/python-tts/bin/activate
Comment on lines +9 to +11
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 | 🔴 Critical

Add error handling and avoid hardcoded paths.

Multiple critical issues:

  1. No error handling if cd fails (also flagged by shellcheck SC2164)
  2. Hardcoded absolute paths (/home/dwemer/) make the script non-portable
  3. No validation that paths exist or are writable

If cd fails, all subsequent operations execute in the wrong directory, potentially causing data corruption or security issues.

🛡️ Recommended fixes
-cd /home/dwemer/xtts-api-server
-python3 -m venv /home/dwemer/python-tts
-source /home/dwemer/python-tts/bin/activate
+# Determine script directory and use relative paths
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" || { echo "Failed to determine script directory"; exit 1; }
+cd "$SCRIPT_DIR" || { echo "Failed to navigate to $SCRIPT_DIR"; exit 1; }
+
+# Allow user to configure paths or use defaults
+VENV_PATH="${VENV_PATH:-$HOME/python-tts}"
+python3 -m venv "$VENV_PATH" || { echo "Failed to create virtual environment at $VENV_PATH"; exit 1; }
+source "$VENV_PATH/bin/activate" || { echo "Failed to activate virtual environment"; exit 1; }

Additionally, consider adding set -euo pipefail at the top of the script to fail fast on errors.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cd /home/dwemer/xtts-api-server
python3 -m venv /home/dwemer/python-tts
source /home/dwemer/python-tts/bin/activate
# Determine script directory and use relative paths
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" || { echo "Failed to determine script directory"; exit 1; }
cd "$SCRIPT_DIR" || { echo "Failed to navigate to $SCRIPT_DIR"; exit 1; }
# Allow user to configure paths or use defaults
VENV_PATH="${VENV_PATH:-$HOME/python-tts}"
python3 -m venv "$VENV_PATH" || { echo "Failed to create virtual environment at $VENV_PATH"; exit 1; }
source "$VENV_PATH/bin/activate" || { echo "Failed to activate virtual environment"; exit 1; }
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 9-9: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

🤖 Prompt for AI Agents
In @ddistro_install.sh around lines 9 - 11, Add strict failure handling and
replace hardcoded paths with configurable variables: set "set -euo pipefail" at
the top, use variables like INSTALL_DIR and VENV_DIR instead of
"/home/dwemer/...", and check the return status of the cd command (the current
"cd /home/dwemer/xtts-api-server" invocation) and exit if it fails. Before
creating the venv (the "python3 -m venv /home/dwemer/python-tts" step) validate
that INSTALL_DIR exists and VENV_DIR parent is writable (create directories if
needed with proper permissions), and ensure "source .../bin/activate" is only
run after the venv was successfully created; fail with an explanatory message on
any error.



PIDS=$(lsof -ti:8020)
if [ -n "$PIDS" ]; then
echo "Killing processes listening on port 8020: $PIDS"
kill -9 $PIDS
fi
Comment on lines +14 to +18
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 | 🟠 Major

Use graceful shutdown before SIGKILL.

Using kill -9 (SIGKILL) unconditionally prevents processes from cleaning up resources, which can cause data loss or corruption. Additionally, there's no validation that the PIDs belong to expected processes.

♻️ Recommended approach for graceful shutdown
 PIDS=$(lsof -ti:8020)
 if [ -n "$PIDS" ]; then
     echo "Killing processes listening on port 8020: $PIDS"
-    kill -9 $PIDS
+    # Try graceful shutdown first
+    kill $PIDS 2>/dev/null || true
+    sleep 2
+    # Force kill if still running
+    REMAINING=$(lsof -ti:8020)
+    if [ -n "$REMAINING" ]; then
+        echo "Force killing remaining processes: $REMAINING"
+        kill -9 $REMAINING
+    fi
 fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
PIDS=$(lsof -ti:8020)
if [ -n "$PIDS" ]; then
echo "Killing processes listening on port 8020: $PIDS"
kill -9 $PIDS
fi
PIDS=$(lsof -ti:8020)
if [ -n "$PIDS" ]; then
echo "Killing processes listening on port 8020: $PIDS"
# Try graceful shutdown first
kill $PIDS 2>/dev/null || true
sleep 2
# Force kill if still running
REMAINING=$(lsof -ti:8020)
if [ -n "$REMAINING" ]; then
echo "Force killing remaining processes: $REMAINING"
kill -9 $REMAINING
fi
fi



echo "This will take a while so please wait."

read -p "Do you want to perform a clean install? (yes/no): " clean_install
if [[ "$clean_install" =~ ^[Yy][Ee][Ss]$ || "$clean_install" =~ ^[Yy]$ ]]; then
rm -fr /home/dwemer/python-tts/*
python3 -m venv /home/dwemer/python-tts
source /home/dwemer/python-tts/bin/activate
fi
Comment on lines +23 to +28
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.

🛠️ Refactor suggestion | 🟠 Major

Update hard-coded paths to use environment variables.

Once parameterization is applied (from the previous comment), update this block:

 read -p "Do you want to perform a clean install? (yes/no): " clean_install
 if [[ "$clean_install" =~ ^[Yy][Ee][Ss]$ || "$clean_install" =~ ^[Yy]$ ]]; then
-    rm -fr /home/dwemer/python-tts/*
-	python3 -m venv /home/dwemer/python-tts
-    source /home/dwemer/python-tts/bin/activate
+    rm -fr "$VENV_DIR"/*
+	python3 -m venv "$VENV_DIR"
+    source "$VENV_DIR/bin/activate"
 fi
🤖 Prompt for AI Agents
In ddistro_install.sh around lines 17 to 22, the script uses the hard-coded path
/home/dwemer/python-tts; replace this with a parameterized variable (e.g.
INSTALL_DIR) defaulting to $HOME/python-tts, ensure you quote the variable
everywhere, create parent dirs with mkdir -p before venv creation, use rm -rf
"$INSTALL_DIR"/* for clean installs, run python3 -m venv "$INSTALL_DIR" and
source "$INSTALL_DIR/bin/activate"; also validate/export INSTALL_DIR at the top
if not provided.

Comment on lines +21 to +28
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 | 🟠 Major

Add safeguards for destructive operations.

The rm -fr command deletes the entire virtual environment without any backup or additional confirmation. If the hardcoded path is misconfigured or if there's a typo, this could delete unintended directories.

🛡️ Recommended safeguards
 read -p "Do you want to perform a clean install? (yes/no): " clean_install
 if [[ "$clean_install" =~ ^[Yy][Ee][Ss]$ || "$clean_install" =~ ^[Yy]$ ]]; then
-    rm -fr /home/dwemer/python-tts/*
+    # Verify path before deletion
+    if [ -d "$VENV_PATH" ] && [[ "$VENV_PATH" == *"python-tts"* ]]; then
+        echo "WARNING: About to delete $VENV_PATH"
+        read -p "Are you absolutely sure? Type 'DELETE' to confirm: " confirm
+        if [ "$confirm" = "DELETE" ]; then
+            rm -fr "$VENV_PATH"
+        else
+            echo "Clean install cancelled"
+            exit 0
+        fi
+    fi
     python3 -m venv /home/dwemer/python-tts
     source /home/dwemer/python-tts/bin/activate
 fi

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In @ddistro_install.sh around lines 21 - 28, The destructive rm -fr
/home/dwemer/python-tts/* in the clean-install branch is unsafe; before removing
the venv contents (triggered by the clean_install variable), validate and
canonicalize the target path, ensure it exactly matches the expected venv
directory (e.g., "/home/dwemer/python-tts"), reject suspicious or root paths,
prompt the user for a secondary explicit confirmation (yes typed), and create a
backup (move or tar) of the existing venv directory before deleting; only
perform the removal after these checks and confirmations, then recreate the venv
and source it as currently done.


# Clean previous deepspeed stuff
rm /home/dwemer/.cache/torch_extensions/py311_cu130/transformer_inference/*
Comment on lines +30 to +31
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 | 🟠 Major

Add error handling for cache cleanup.

The cache cleanup operation on Line 31 will fail silently if the path doesn't exist, if there are permission issues, or if the wildcard doesn't match any files.

♻️ Recommended fix
 # Clean previous deepspeed stuff
-rm /home/dwemer/.cache/torch_extensions/py311_cu130/transformer_inference/*
+CACHE_DIR="$HOME/.cache/torch_extensions/py311_cu130/transformer_inference"
+if [ -d "$CACHE_DIR" ]; then
+    echo "Cleaning deepspeed cache at $CACHE_DIR"
+    rm -f "$CACHE_DIR"/* || echo "Warning: Failed to clean some cache files"
+fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Clean previous deepspeed stuff
rm /home/dwemer/.cache/torch_extensions/py311_cu130/transformer_inference/*
# Clean previous deepspeed stuff
CACHE_DIR="$HOME/.cache/torch_extensions/py311_cu130/transformer_inference"
if [ -d "$CACHE_DIR" ]; then
echo "Cleaning deepspeed cache at $CACHE_DIR"
rm -f "$CACHE_DIR"/* || echo "Warning: Failed to clean some cache files"
fi
🤖 Prompt for AI Agents
In @ddistro_install.sh around lines 30 - 31, The rm command that deletes the
transformer_inference cache can fail silently; update ddistro_install.sh to
first check that the transformer_inference directory exists and is readable,
then delete files with a safe rm invocation and explicitly handle errors: if the
directory is missing skip with a logged notice, otherwise run a protected
removal (use -- or -f/-r as appropriate) and if rm fails capture and log the
error and exit non‑zero so the failure is visible. Reference the existing rm
invocation that targets the transformer_inference cache directory and replace it
with the described existence check + guarded removal + error logging/exit.

# Ask user about GPU
read -p "Are you using a GT10XX series GPU? (yes/no): " gpu_answer
if [[ "$gpu_answer" =~ ^[Yy][Ee][Ss]$ || "$gpu_answer" =~ ^[Yy]$ ]]; then
cu_tag="cu118"
torch_url="https://download.pytorch.org/whl/${cu_tag}"
torch_ver="2.2.2"
torchaudio_ver="2.2.2"
python3 -m pip install --upgrade pip wheel ninja virtualenv
pip install setuptools==68.1.2
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.

🛠️ Refactor suggestion | 🟠 Major

Consistently use python3 -m pip instead of bare pip in the venv.

Mixing bare pip (lines 34, 36, 39, 53, 78, 80, 85) and python3 -m pip (line 33, 52, 77) creates ambiguity about which Python interpreter is active. Once activated in a venv, bare pip usually works, but it's not guaranteed and is not portable across environments.

For consistency and portability, replace all bare pip invocations with python3 -m pip throughout this section.

Also applies to: 36-36, 39-39, 53-53, 56-56, 78-78, 80-80, 85-85

🤖 Prompt for AI Agents
ddistro_install.sh lines 34, 36, 39, 53, 56, 78, 80, 85: several commands use
bare pip while nearby lines use python3 -m pip, causing ambiguity about which
interpreter is invoked; replace each bare `pip` invocation on these lines with
`python3 -m pip` (keeping the same arguments and versions) so all package
installs consistently run via the intended Python interpreter (e.g., change `pip
install setuptools==68.1.2` to `python3 -m pip install setuptools==68.1.2` and
do the same for every other bare pip occurrence listed).

# Install app requirements without auto-pulling torch/torchaudio from deps
pip install --no-deps -r requirements.txt
# Pin to stable, CUDA-tagged PyTorch/Torchaudio that do not require TorchCodec
pip cache purge || true
pip uninstall -y torch torchaudio torchcodec torchvision || true
pip install --no-deps --no-cache-dir --index-url "$torch_url" "torch==${torch_ver}+${cu_tag}" "torchaudio==${torchaudio_ver}+${cu_tag}"
pip check || true
# Ensure fallback audio loader is available
pip install --no-cache-dir soundfile
sed -i 's/checkpoint = load_fsspec(model_path, map_location=torch.device("cpu"))\["model"\]/checkpoint = load_fsspec(model_path, map_location=torch.device("cpu"), weights_only=False)["model"]/' /home/dwemer/python-tts/lib/python3.11/site-packages/TTS/tts/models/xtts.py
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 | 🔴 Critical

Avoid directly patching installed packages.

Directly modifying installed package files with sed is extremely fragile and will break when:

  • The TTS package is updated
  • The Python version changes (hardcoded to 3.11)
  • The virtual environment path changes
  • The file structure or content changes

Additionally, this disables PyTorch's weights_only security feature without documenting why.

🔧 Recommended alternatives

Option 1 (preferred): Use a proper patch file that can be validated:

# Create a patch file: xtts_weights_only.patch
# Then apply it with verification:
XTTS_FILE="$VENV_PATH/lib/python3.11/site-packages/TTS/tts/models/xtts.py"
if [ -f "$XTTS_FILE" ]; then
    patch --dry-run "$XTTS_FILE" < xtts_weights_only.patch && \
    patch "$XTTS_FILE" < xtts_weights_only.patch || \
    echo "ERROR: Failed to apply xtts patch. Manual intervention required."
else
    echo "ERROR: XTTS file not found at expected location"
    exit 1
fi

Option 2: Fork the TTS package or submit a PR upstream to add a configuration option for weights_only.

Option 3: Document this as a known limitation and provide manual patching instructions in the README.

🤖 Prompt for AI Agents
In @ddistro_install.sh at line 50, The script is directly patching installed
package files with sed (modifying TTS/tts/models/xtts.py to change the
load_fsspec call to include weights_only=False), which is fragile; instead
create a validated patch apply step that locates the virtualenv path dynamically
(use a VENV_PATH variable rather than hardcoded python3.11 path), verify the
target file exists, run patch --dry-run against xtts.py and only apply if the
dry-run succeeds, and exit with an error if the patch cannot be applied;
alternatively document the change or upstream/fork the package to add a
configurable weights_only option for load_fsspec rather than forcing
weights_only=False at runtime.


else
read -p "New: Use CUDA13. Needs windows updated drivers. RTX 50XX should use this. Usey cuda13? (yes/no): " gpu5_answer
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

Fix typo in user prompt.

"Usey cuda13?" should be "Use cuda13?"

📝 Fix
-    read -p "New: Use CUDA13. Needs windows updated drivers. RTX 50XX should use this. Usey cuda13? (yes/no): " gpu5_answer
+    read -p "New: Use CUDA13. Needs updated drivers. RTX 50XX should use this. Use cuda13? (yes/no): " gpu5_answer
🤖 Prompt for AI Agents
In @ddistro_install.sh at line 53, The user prompt string in the read -p call
assigns to variable gpu5_answer but contains a typo "Usey cuda13?"; update the
prompt text to read "Use cuda13? (yes/no): " so the question is spelled
correctly and still includes the context about CUDA13 and driver note while
leaving the variable name gpu5_answer unchanged.

if [[ "$gpu5_answer" =~ ^[Yy][Ee][Ss]$ || "$gpu5_answer" =~ ^[Yy]$ ]]; then
cu_tag="cu130"
torch_url="https://download.pytorch.org/whl/${cu_tag}"
echo "Using torch: $torch_url"
python3 -m pip install --upgrade pip wheel ninja virtualenv
pip install setuptools==68.1.2
# Install app requirements without auto-pulling torch/torchaudio from deps
#pip install --no-deps -r requirements5.txt --index-url=$torch_url
pip install -r requirements5.txt --extra-index-url=https://download.pytorch.org/whl/cu130
# Pin to stable, CUDA-tagged PyTorch/Torchaudio that do not require TorchCodec
pip check || true
# Ensure fallback audio loader is available
pip install --no-cache-dir soundfile
# Fix symlinks
LIBDIR=$(python3 -c 'import site; print(site.getsitepackages()[0])')/nvidia/cu13/lib
for f in "$LIBDIR"/lib*.so.*; do
base=$(basename "$f")
link="${f%%.so.*}.so"
if [ ! -e "$link" ]; then
echo "Creating symlink: $(basename "$link") -> $base"
ln -s "$base" "$link"
fi
done
#pip install xtts-api-server #Fails

else
cu_tag="cu128"
torch_url="https://download.pytorch.org/whl/${cu_tag}"
echo "Using torch: $torch_url"
python3 -m pip install --upgrade pip wheel ninja virtualenv
pip install setuptools==68.1.2
# Install app requirements without auto-pulling torch/torchaudio from deps
pip install --no-deps -r requirements.txt
# Pin to stable, CUDA-tagged PyTorch/Torchaudio that do not require TorchCodec
pip cache purge || true
pip uninstall -y torch torchaudio torchcodec torchvision || true
#pip install --index-url "$torch_url" torch torchaudio torchcodec torchvision
pip install torch==2.7.0+cu128 torchaudio==2.7.0+cu128 torchvision==0.22.0+cu128 --index-url=https://download.pytorch.org/whl/
pip check || true
# Ensure fallback audio loader is available
pip install --no-cache-dir soundfile
#pip install xtts-api-server #Fails
sed -i 's/checkpoint = load_fsspec(model_path, map_location=torch.device("cpu"))\["model"\]/checkpoint = load_fsspec(model_path, map_location=torch.device("cpu"), weights_only=False)["model"]/' /home/dwemer/python-tts/lib/python3.11/site-packages/TTS/tts/models/xtts.py
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 | 🔴 Critical

Inconsistent patching across installation paths.

This line has the same critical sed patching issue as Line 50. However, this patch is only applied in the CUDA128 installation path and not in the CUDA13 path (lines 52-78), creating inconsistent behavior.

Either:

  1. The CUDA13 path is missing this patch (bug), or
  2. The CUDA13 path doesn't need this patch (should be documented why)

Refer to the review comment on Line 50 for recommended fixes to the patching approach.

🤖 Prompt for AI Agents
In @ddistro_install.sh at line 96, The CUDA13 install branch is missing the same
sed patch applied in the CUDA128 branch that replaces the checkpoint load call
in TTS/tts/models/xtts.py (the sed command that adds weights_only=False),
causing inconsistent behavior; modify ddistro_install.sh so the same sed
replacement (the sed invocation that alters load_fsspec(...,
weights_only=False)["model"]) is run for the CUDA13 path as well (or move the
patching to a common post-install step executed for both branches), ensuring the
xtts.py replacement is applied consistently across both CUDA13 and CUDA128
installations.


fi
fi


cp /home/dwemer/TheNarrator.wav speakers/TheNarrator.wav
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

Check file existence before copying speaker sample.

Copying /home/dwemer/TheNarrator.wav without verifying it exists will fail silently or with an unclear error. Add a guard:

if [[ ! -f "$SAMPLE_PATH" ]]; then
  echo "Error: sample file not found at $SAMPLE_PATH"
  exit 1
fi
cp "$SAMPLE_PATH" "${BASE_DIR}/speakers/"


source /home/dwemer/python-tts/bin/activate

./conf.sh
Comment on lines +102 to +106
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 | 🟠 Major

Validate file existence before operations.

Both the cp and ./conf.sh commands will fail with unclear errors if the files don't exist or aren't accessible. This creates a poor user experience during installation.

♻️ Recommended validation
+# Copy speaker sample if available
+NARRATOR_SOURCE="/home/dwemer/TheNarrator.wav"  # TODO: Make configurable
+if [ -f "$NARRATOR_SOURCE" ]; then
-cp /home/dwemer/TheNarrator.wav speakers/TheNarrator.wav
+    cp "$NARRATOR_SOURCE" speakers/TheNarrator.wav
+else
+    echo "Warning: TheNarrator.wav not found at $NARRATOR_SOURCE"
+fi

 source /home/dwemer/python-tts/bin/activate

-./conf.sh
+if [ -x ./conf.sh ]; then
+    ./conf.sh
+else
+    echo "ERROR: conf.sh not found or not executable"
+    exit 1
+fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cp /home/dwemer/TheNarrator.wav speakers/TheNarrator.wav
source /home/dwemer/python-tts/bin/activate
./conf.sh
# Copy speaker sample if available
NARRATOR_SOURCE="/home/dwemer/TheNarrator.wav" # TODO: Make configurable
if [ -f "$NARRATOR_SOURCE" ]; then
cp "$NARRATOR_SOURCE" speakers/TheNarrator.wav
else
echo "Warning: TheNarrator.wav not found at $NARRATOR_SOURCE"
fi
source /home/dwemer/python-tts/bin/activate
if [ -x ./conf.sh ]; then
./conf.sh
else
echo "ERROR: conf.sh not found or not executable"
exit 1
fi
🤖 Prompt for AI Agents
In @ddistro_install.sh around lines 102 - 106, The script blindly runs the cp
and ./conf.sh steps; add pre-flight checks to ensure
/home/dwemer/TheNarrator.wav exists and the target directory (speakers/) is
present/writable before running cp (create speakers/ with mkdir -p if missing),
and verify ./conf.sh exists and is executable before invoking it (or exit with a
clear error). In practice, update the block around the cp command and the
invocation of conf.sh to perform file/directory existence checks (using test
-f/-d or similar), emit descriptive error messages, and exit non‑zero on failure
so the installer fails fast with a clear reason.


echo
echo "This will start CHIM XTTS to download the selected model"
echo "Wait for the message 'Uvicorn running on http://0.0.0.0:8020 (Press CTRL+C to quit)'"
echo "Then close this window. Press ENTER to continue"
read

echo "please wait...."

# Add CUDA to PATH if the directory exists
if [ -d "/home/dwemer/python-tts/lib/python3.11/site-packages/nvidia/cu13/lib/" ];
then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/dwemer/python-tts/lib/python3.11/site-packages/nvidia/cu13/lib/
export PATH=/home/dwemer/python-tts/lib/python3.11/site-packages/nvidia/cu13/bin:$PATH
export CUDA_HOME=/home/dwemer/python-tts/lib/python3.11/site-packages/nvidia/cu13
fi
Comment on lines +117 to +122
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 | 🟠 Major

Use runtime path resolution for CUDA libraries instead of hard-coded python3.11.

The conditional path and environment variables hard-code python3.11. This will fail silently on other Python versions.

-if [ -d "/home/dwemer/python-tts/lib/python3.11/site-packages/nvidia/cu13/lib/" ];
+CUDA_LIB_PATH="$(/home/dwemer/python-tts/bin/python -c 'import sysconfig, pathlib; p = pathlib.Path(sysconfig.get_path("purelib")) / "nvidia/cu13/lib"; print(p if p.exists() else "")')"
+if [ -n "$CUDA_LIB_PATH" ] && [ -d "$CUDA_LIB_PATH" ];
 then
-  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/dwemer/python-tts/lib/python3.11/site-packages/nvidia/cu13/lib/
-  export PATH=/home/dwemer/python-tts/lib/python3.11/site-packages/nvidia/cu13/bin:$PATH
-  export CUDA_HOME=/home/dwemer/python-tts/lib/python3.11/site-packages/nvidia/cu13
+  export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${CUDA_LIB_PATH}"
+  export PATH="$(dirname "$CUDA_LIB_PATH")/bin:$PATH"
+  export CUDA_HOME="$(dirname "$CUDA_LIB_PATH")/.."
 fi

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In ddistro_install.sh around lines 95-100, the script hard-codes a python3.11
site-packages path for CUDA libs; replace the hard-coded path with a
runtime-resolved site-packages base (call python to print the site-packages or
sysconfig path and store it in a variable) and then build the nvidia/cu13 lib
and bin paths from that variable before checking/setting LD_LIBRARY_PATH, PATH
and CUDA_HOME so the script works for other Python versions/environments.


readlink start.sh | grep -q '/home/dwemer/xtts-api-server/start-deepspeed.sh' && export DEEPSPEED="--deepspeed" || export DEEPSPEED=""
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 | 🟠 Major

Simplify and add error handling for deepspeed detection.

The command using readlink and grep is fragile and assumes start.sh is a symlink. The logic can fail silently if:

  • start.sh doesn't exist
  • start.sh is not a symlink
  • The path doesn't match exactly
♻️ Recommended approach
-readlink start.sh | grep -q '/home/dwemer/xtts-api-server/start-deepspeed.sh' && export DEEPSPEED="--deepspeed" ||  export DEEPSPEED=""
+# Check if deepspeed should be enabled
+if [ -L start.sh ]; then
+    TARGET=$(readlink start.sh)
+    if [[ "$TARGET" == *"start-deepspeed.sh"* ]]; then
+        export DEEPSPEED="--deepspeed"
+        echo "Deepspeed mode enabled"
+    else
+        export DEEPSPEED=""
+    fi
+else
+    export DEEPSPEED=""
+    echo "Note: start.sh is not a symlink, deepspeed mode not auto-detected"
+fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
readlink start.sh | grep -q '/home/dwemer/xtts-api-server/start-deepspeed.sh' && export DEEPSPEED="--deepspeed" || export DEEPSPEED=""
# Check if deepspeed should be enabled
if [ -L start.sh ]; then
TARGET=$(readlink start.sh)
if [[ "$TARGET" == *"start-deepspeed.sh"* ]]; then
export DEEPSPEED="--deepspeed"
echo "Deepspeed mode enabled"
else
export DEEPSPEED=""
fi
else
export DEEPSPEED=""
echo "Note: start.sh is not a symlink, deepspeed mode not auto-detected"
fi


python -m xtts_api_server --listen $DEEPSPEED
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 | 🟠 Major

Verify installation before starting the server.

The server is started without verifying that the installation succeeded or that the xtts_api_server module is available. This can result in unclear error messages if any previous step failed.

✅ Recommended validation
+# Verify installation succeeded
+if ! python -c "import xtts_api_server" 2>/dev/null; then
+    echo "ERROR: xtts_api_server module not found. Installation may have failed."
+    echo "Check the output above for errors."
+    exit 1
+fi
+
+echo "Starting XTTS API server..."
 python -m xtts_api_server --listen $DEEPSPEED
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
python -m xtts_api_server --listen $DEEPSPEED
# Verify installation succeeded
if ! python -c "import xtts_api_server" 2>/dev/null; then
echo "ERROR: xtts_api_server module not found. Installation may have failed."
echo "Check the output above for errors."
exit 1
fi
echo "Starting XTTS API server..."
python -m xtts_api_server --listen $DEEPSPEED
🤖 Prompt for AI Agents
In @ddistro_install.sh at line 126, Before running "python -m xtts_api_server
--listen $DEEPSPEED" verify the installation and module availability by checking
the prior install command exit code and performing an import check (e.g., run a
quick "python -c 'import xtts_api_server'" or "python -m pip show
xtts_api_server"); if the check fails, log a clear error and exit non‑zero
instead of attempting to start xtts_api_server; ensure the script references the
same "xtts_api_server" and "$DEEPSPEED" variables so the start command only runs
after successful validation.


echo "Press Enter"
Comment on lines +1 to +128
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.

🛠️ Refactor suggestion | 🟠 Major

Add overall error handling and improve script robustness.

The script lacks a comprehensive error handling strategy, which makes it difficult to debug when things go wrong and creates a poor user experience. Additionally, the extensive use of hardcoded paths makes the script non-portable.

Recommended improvements:

  1. Add error handling at the top:
#!/bin/bash
set -euo pipefail  # Exit on error, undefined variables, and pipe failures

# Trap errors and provide helpful messages
trap 'echo "ERROR: Installation failed at line $LINENO. Check output above for details." >&2' ERR
  1. Use configurable paths instead of hardcoded ones:
# Configuration section at top of file
BASE_DIR="${BASE_DIR:-$HOME/xtts-api-server}"
VENV_PATH="${VENV_PATH:-$HOME/python-tts}"
NARRATOR_PATH="${NARRATOR_PATH:-$HOME/TheNarrator.wav}"
  1. Add a validation function:
check_command() {
    if ! command -v "$1" &> /dev/null; then
        echo "ERROR: Required command '$1' not found. Please install it first."
        exit 1
    fi
}

check_command python3
check_command lsof
check_command pip
  1. Add logging:
LOG_FILE="./install_$(date +%Y%m%d_%H%M%S).log"
exec > >(tee -a "$LOG_FILE") 2>&1
echo "Installation log: $LOG_FILE"
  1. Fix indentation: The script uses mixed tabs and spaces. Choose one and be consistent (spaces are recommended for bash scripts).
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 9-9: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

🤖 Prompt for AI Agents
In @ddistro_install.sh around lines 1 - 128, Summary: the install script lacks
error handling, uses hardcoded paths, has no validation or logging, and mixes
indentation styles; fix by adding strict mode and a trap (use set -euo pipefail
and a trap on ERR), introduce configurable top-level variables (BASE_DIR,
VENV_PATH, NARRATOR_PATH) and replace literal "/home/dwemer/..." references with
those variables (used where venv is created/activated, site-packages paths, cp
and cd), add a small check_command function and call it for required commands
(python3, lsof, pip) to fail fast, add a LOG_FILE and redirect stdout/stderr to
it via exec >(tee -a "$LOG_FILE") 2>&1 for install logging, and normalize
indentation to spaces across the file; update usages of
DEEPSPEED/xtts_api_server/start scripts to reference BASE_DIR/VENV_PATH
variables accordingly.

Loading