add http client demo for python

This commit is contained in:
iflamed
2024-07-10 23:25:32 +08:00
parent ee5cb5d231
commit 75cb175ff5

View File

@@ -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**