add fastapi client

This commit is contained in:
iflamed
2024-07-10 23:11:45 +08:00
parent a4ab4ead5f
commit eb53ccbc19
3 changed files with 90 additions and 2 deletions

View File

@@ -121,10 +121,13 @@ You can get familiar with CosyVoice following this recipie.
The `main.py` file has added a `TTS` api with `CosyVoice-300M-SFT` model, you can update the code based on **Basic Usage** as above.
```sh
cd runtime/python
# Set inference model
export MODEL_DIR=pretrained_models/CosyVoice-300M-Instruct
# For development
fastapi dev --port 3003
fastapi dev --port 6006 fastapi_server.py
# For production
fastapi run --port 3003
fastapi run --port 6006 fastapi_server.py
```
**Build for deployment**