Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 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
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: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ fugashi[unidic-lite]
coqui-tts[languages]==0.24.1
transformers==4.36.2
uuid
spacy==3.7.2
spacy==3.7.2
python-multipart
13 changes: 12 additions & 1 deletion xtts_api_server/server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from TTS.api import TTS
from fastapi import BackgroundTasks, FastAPI, HTTPException, Request, Query
from fastapi import BackgroundTasks, FastAPI, HTTPException, Request, Query, File, UploadFile
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove unused imports to clean up the code.

- from TTS.api import TTS
- import time
- import shutil
- from argparse import ArgumentParser
- from pathlib import Path

Committable suggestion was skipped due to low confidence.

from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import FileResponse,StreamingResponse

Expand Down Expand Up @@ -203,6 +203,17 @@ def set_speaker_folder(speaker_req: SpeakerFolderRequest):
logger.error(e)
raise HTTPException(status_code=400, detail=str(e))

@app.post("/upload_sample")
async def upload_sample(wavFile: UploadFile = File(...)):
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid using File(...) as a default argument.

- async def upload_sample(wavFile: UploadFile = File(...)):
+ async def upload_sample(wavFile: UploadFile = None):
+     if wavFile is None:
+         wavFile = File(...)
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
async def upload_sample(wavFile: UploadFile = File(...)):
async def upload_sample(wavFile: UploadFile = None):
if wavFile is None:
wavFile = File(...)
Tools
Ruff

207-207: Do not perform function call File in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable (B008)


UPLOAD_DIR = XTTS.speaker_folder
os.makedirs(UPLOAD_DIR, exist_ok=True)
file_path = os.path.join(UPLOAD_DIR, wavFile.filename)
with open(file_path, "wb") as file_object:
file_object.write(await wavFile.read())
return {"filename": wavFile.filename}


@app.post("/switch_model")
def switch_model(modelReq: ModelNameRequest):
try:
Expand Down