xtts-api-server icon indicating copy to clipboard operation
xtts-api-server copied to clipboard

Add /upload_sample route to allow upload new speakers using Web API

Open abeiro opened this issue 1 year ago • 2 comments

  • Added route to upload sample into speakers folder, so you can upload new speakers using API
  • Added python-multipart to requirements

Summary by CodeRabbit

  • New Features

    • Three service start modes (DeepSpeed, Low VRAM, Regular) with background launch and logging.
    • Interactive configuration utility to choose and enable the active start mode.
    • Installer script to automate environment setup, GPU/runtime selection, and service startup.
  • Chores

    • Added a local file to be ignored by version control.
    • Bulk update and reorganization of pinned Python dependencies.

abeiro avatar Jun 11 '24 10:06 abeiro

Walkthrough

Adds modules-xtts.txt to .gitignore, replaces requirements.txt with a large pinned dependency set and adds requirements5.txt, and introduces installer/configuration scripts plus three mode-specific start scripts to configure and run the XTTSv2 FastAPI TTS service.

Changes

Cohort / File(s) Change Summary
Git ignore
\.gitignore
Added modules-xtts.txt to the ignore list.
Dependencies
requirements.txt, requirements5.txt
requirements.txt extensively revised with many pinned packages added/removed/updated; added requirements5.txt with a CUDA-tagged, pinned dependency set.
Configuration selector
conf.sh
New interactive Bash script to enumerate start-*.sh files and create/remove /home/dwemer/xtts-api-server/start.sh symlink based on user selection.
Installer / environment
ddistro_install.sh
New installer script: creates/activates venv at /home/dwemer/python-tts, prompts for GPU/CUDA options, installs tooling and wheels (handles Torch wheel selection), applies a small code patch, copies assets, invokes conf.sh, and starts the server.
Start scripts (modes)
start-deepspeed.sh, start-lowvram.sh, start-regular.sh
Three new mode-specific start scripts that set PATH/LD_LIBRARY_PATH, activate venv, and launch xtts_api_server with corresponding flags (--deepspeed, --lowvram, or regular), logging to log.txt and running in background.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Conf as conf.sh
    participant FS as Filesystem

    User->>Conf: run conf.sh
    Conf->>FS: check /home/dwemer/python-tts exists
    Conf->>FS: list /home/dwemer/xtts-api-server/start-*.sh
    Conf->>User: show numbered menu (0 = disable)
    User->>Conf: select option
    Conf->>FS: create/update or remove symlink /home/dwemer/xtts-api-server/start.sh
    Conf->>User: confirm selection / exit on error
sequenceDiagram
    participant User
    participant Installer as ddistro_install.sh
    participant Venv as PythonEnv
    participant FS as Filesystem
    participant Conf as conf.sh
    participant Server as xtts_api_server

    User->>Installer: run installer
    Installer->>FS: cd to server dir
    Installer->>Venv: create & activate venv (/home/dwemer/python-tts)
    Installer->>User: prompt for GPU/CUDA choice
    User->>Installer: choose GPU/CUDA option
    Installer->>Venv: install tooling & requirements (select Torch wheel), apply file patch
    Installer->>FS: copy assets (e.g., TheNarrator.wav)
    Installer->>Conf: invoke conf.sh to set start.sh symlink
    Installer->>Server: start xtts_api_server (--listen, optional --deepspeed) and tail logs

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Review focus:
    • Large dependency changes in requirements.txt and consistency with requirements5.txt.
    • Safety, idempotence and error handling in ddistro_install.sh (wheel selection, symlinks, in-place edits).
    • Input validation and symlink manipulation in conf.sh.
    • Environment activation and LD_LIBRARY_PATH / CUDA path handling in start-*.sh.

Poem

I hopped through folders, twitching my nose,
I hid a file where quiet modules doze.
I pinned the packages, tidy and neat,
Wrote scripts to wake the server on its feet.
Choose a start, little human — the rabbit hums, ready to greet. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The PR title states the objective is to "Add /upload_sample route to allow upload new speakers using Web API," which implies the primary change is implementing a new API endpoint. However, the raw summary of file changes shows modifications to .gitignore, requirements.txt, and several new infrastructure/deployment scripts (conf.sh, ddistro_install.sh, start-*.sh variants, and requirements5.txt). The summary provided does not include any description of API route implementation or modifications to application code files that would contain the /upload_sample endpoint. Instead, the changes are predominantly infrastructure, configuration scripts, and dependency management rather than the API route addition claimed in the title. This represents a disconnect between the stated primary change and the actual file modifications evident in the changeset. The title should be revised to accurately reflect the primary changes in this changeset. If the PR is primarily about adding infrastructure scripts, deployment configurations, and updating dependencies, the title should reflect that focus. Alternatively, if the /upload_sample route implementation exists in a file not documented in the provided summary, the raw summary should be verified to include the actual application code changes implementing this endpoint to ensure the title accurately matches the core modifications.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8164e9442207c58b56a3f9b6545b1859a8a97210 and 6f08109aa1e9f64f2d708f68925a97d40753af70.

📒 Files selected for processing (1)
  • requirements5.txt (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • requirements5.txt

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.

coderabbitai[bot] avatar Jun 11 '24 10:06 coderabbitai[bot]

Great, thanks, I'll take a look tomorrow. I've been trying to add it myself but haven't had the time )

daswer123 avatar Jun 11 '24 11:06 daswer123