https://github.com/bentoml/bentoxtts
how to build an text-to-speech application using BentoML
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.5%) to scientific vocabulary
Repository
how to build an text-to-speech application using BentoML
Basic Info
- Host: GitHub
- Owner: bentoml
- Language: Python
- Default Branch: main
- Size: 807 KB
Statistics
- Stars: 12
- Watchers: 6
- Forks: 3
- Open Issues: 4
- Releases: 0
Metadata Files
README.md
Serving XTTS with BentoML
XTTS is a voice generation model that lets you clone voices into different languages by using just a quick 6-second audio clip.
This is a BentoML example project, demonstrating how to build a text-to-speech inference API server using the XTTS model. See here for a full list of BentoML example projects.
Install dependencies
```bash git clone https://github.com/bentoml/BentoXTTS.git cd BentoXTTS
Recommend Python 3.11
pip install -r requirements.txt ```
Run the BentoML Service
We have defined a BentoML Service in service.py. Run bentoml serve in your project directory to start the Service. You may also set the environment variable COQUI_TTS_AGREED=1 to agree to the terms of Coqui TTS.
```python $ COQUITOSAGREED=1 bentoml serve .
2024-01-18T11:13:54+0800 [INFO] [cli] Starting production HTTP BentoServer from "service:XTTS" listening on http://localhost:3000 (Press CTRL+C to quit)
/workspace/codes/examples/xtts/venv/lib/python3.10/site-packages/TTS/api.py:70: UserWarning: gpu will be deprecated. Please use tts.to(device) instead.
warnings.warn("gpu will be deprecated. Please use tts.to(device) instead.")
ttsmodels/multilingual/multi-dataset/xttsv2 is already downloaded. Using model: xtts ```
The server is now active at http://localhost:3000. You can interact with it using the Swagger UI or in other different ways.
CURL
bash
curl -X 'POST' \
'http://localhost:3000/synthesize' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"text": "It took me quite a long time to develop a voice and now that I have it I am not going to be silent.",
"lang": "en"
}' -o output.wav
Python client
This client returns the audio file as a Path object. You can use it to access or process the file. See Clients for details.
```python import bentoml
with bentoml.SyncHTTPClient("http://localhost:3000") as client: result = client.synthesize( text="It took me quite a long time to develop a voice and now that I have it I am not going to be silent.", lang="en" ) ```
For detailed explanations of the Service code, see XTTS: Text to speech.
Deploy to BentoCloud
After the Service is ready, you can deploy the application to BentoCloud for better management and scalability. Sign up if you haven't got a BentoCloud account.
Make sure you have logged in to BentoCloud, then run the following command to deploy it.
bash
bentoml deploy .
Once the application is up and running on BentoCloud, you can access it via the exposed URL.
Note: For custom deployment in your own infrastructure, use BentoML to generate an OCI-compliant image.
Owner
- Name: BentoML
- Login: bentoml
- Kind: organization
- Location: San Francisco
- Website: https://bentoml.com
- Twitter: bentomlai
- Repositories: 76
- Profile: https://github.com/bentoml
The most flexible way to serve AI models in production
GitHub Events
Total
- Watch event: 5
- Push event: 1
- Pull request review event: 1
- Pull request event: 2
- Fork event: 1
- Create event: 1
Last Year
- Watch event: 5
- Push event: 1
- Pull request review event: 1
- Pull request event: 2
- Fork event: 1
- Create event: 1
Issues and Pull Requests
Last synced: over 1 year ago
All Time
- Total issues: 1
- Total pull requests: 8
- Average time to close issues: N/A
- Average time to close pull requests: 1 day
- Total issue authors: 1
- Total pull request authors: 3
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 5
- Bot issues: 0
- Bot pull requests: 1
Past Year
- Issues: 1
- Pull requests: 8
- Average time to close issues: N/A
- Average time to close pull requests: 1 day
- Issue authors: 1
- Pull request authors: 3
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 5
- Bot issues: 0
- Bot pull requests: 1
Top Authors
Issue Authors
- ahmedkotb98 (1)
Pull Request Authors
- Sherlock113 (11)
- dependabot[bot] (2)
- lycheel1 (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- TTS ==0.22.0
- bentoml >=1.2.0rc1
- transformers ==4.36.2
- triton ==2.1.0