mirror of
https://github.com/FunAudioLLM/CosyVoice.git
synced 2026-02-05 01:49:25 +08:00
add http client demo for python
This commit is contained in:
@@ -125,10 +125,14 @@ The `runtime/python/fastapi_server.py` file contains the http API build with `Fa
|
|||||||
cd runtime/python
|
cd runtime/python
|
||||||
# Set inference model
|
# Set inference model
|
||||||
export MODEL_DIR=pretrained_models/CosyVoice-300M-Instruct
|
export MODEL_DIR=pretrained_models/CosyVoice-300M-Instruct
|
||||||
|
|
||||||
# For development
|
# For development
|
||||||
fastapi dev --port 6006 fastapi_server.py
|
fastapi dev --port 6006 fastapi_server.py
|
||||||
# For production
|
# For production
|
||||||
fastapi run --port 6006 fastapi_server.py
|
fastapi run --port 6006 fastapi_server.py
|
||||||
|
|
||||||
|
# Call the API with python client
|
||||||
|
python fastapi_client.py --api_base http://127.0.0.1:6006 --mode cross_lingual --tts_wav ./demo.wav
|
||||||
```
|
```
|
||||||
|
|
||||||
**Build for deployment**
|
**Build for deployment**
|
||||||
|
|||||||
Reference in New Issue
Block a user