-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add TTS fastdeploy serving #2528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9e61b81
add triton tts server
HexToString 8de92a8
Merge branch 'develop' of https://github.com/HexToString/PaddleSpeech…
HexToString a8cf222
change readme
HexToString 6a14b1b
fix path bug
HexToString 7cf94a3
fix code style
HexToString 05e57d8
fix code style and readme
HexToString e161d8d
Add files via upload
HexToString File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
([简体中文](./README_cn.md)|English) | ||
|
||
# Streaming Speech Synthesis Service | ||
|
||
## Introduction | ||
This demo is an implementation of starting the streaming speech synthesis service and accessing the service. | ||
|
||
`Server` must be started in the docker, while `Client` does not have to be in the docker. | ||
|
||
We assume your model and code (which will be loaded by the `Server`) absolute path in your host is `$PWD` and the model absolute path in docker is `/models` | ||
|
||
## Usage | ||
### 1. Server | ||
#### 1.1 Docker | ||
|
||
`docker pull registry.baidubce.com/paddlepaddle/fastdeploy_serving_cpu_only:22.09` | ||
|
||
`docker run -dit --net=host --name fastdeploy --shm-size="1g" -v $PWD:/models registry.baidubce.com/paddlepaddle/fastdeploy_serving_cpu_only:22.09` | ||
|
||
`docker exec -it -u root fastdeploy bash` | ||
|
||
#### 1.2 Installation(inside the docker) | ||
|
||
`apt-get install build-essential python3-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev zlib1g-dev libsndfile1 language-pack-zh-hans wget zip` | ||
|
||
`pip3 install paddlespeech` | ||
|
||
`export LC_ALL="zh_CN.UTF-8"` | ||
|
||
`export LANG="zh_CN.UTF-8"` | ||
|
||
`export LANGUAGE="zh_CN:zh:en_US:en"` | ||
|
||
#### 1.3 Download models(inside the docker) | ||
|
||
`cd /models/streaming_tts_serving/1` | ||
|
||
`wget https://paddlespeech.bj.bcebos.com/Parakeet/released_models/fastspeech2/fastspeech2_cnndecoder_csmsc_streaming_onnx_1.0.0.zip` | ||
|
||
`wget https://paddlespeech.bj.bcebos.com/Parakeet/released_models/mb_melgan/mb_melgan_csmsc_onnx_0.2.0.zip` | ||
|
||
`unzip fastspeech2_cnndecoder_csmsc_streaming_onnx_1.0.0.zip` | ||
|
||
`unzip mb_melgan_csmsc_onnx_0.2.0.zip` | ||
|
||
#### 1.4 Start the server(inside the docker) | ||
|
||
`fastdeployserver --model-repository=/models --model-control-mode=explicit --load-model=streaming_tts_serving` | ||
|
||
**The default port is 8000(for http),8001(for grpc),8002(for metrics). If you want to change the port, add the command `--http-port 9000 --grpc-port 9001 --metrics-port 9002`** | ||
|
||
### 2. Client | ||
#### 2.1 Installation | ||
|
||
`pip3 install tritonclient[all]` | ||
|
||
#### 2.2 Send request | ||
|
||
`python3 /models/streaming_tts_serving/stream_client.py` | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
(简体中文|[English](./README.md)) | ||
|
||
# 流式语音合成服务 | ||
|
||
## 介绍 | ||
本文介绍了使用FastDeploy搭建流式语音合成服务的方法。 | ||
|
||
`服务端`必须在docker内启动,而`客户端`不是必须在docker容器内. | ||
|
||
我们假设你的模型和代码(`服务端`会加载模型和代码以启动服务)在你主机上的绝对路径是`$PWD`,模型和代码在docker内的绝对路径是`/models` | ||
|
||
## 使用 | ||
### 1. 服务端 | ||
#### 1.1 Docker | ||
|
||
`docker pull registry.baidubce.com/paddlepaddle/fastdeploy_serving_cpu_only:22.09` | ||
|
||
`docker run -dit --net=host --name fastdeploy --shm-size="1g" -v $PWD:/models registry.baidubce.com/paddlepaddle/fastdeploy_serving_cpu_only:22.09` | ||
|
||
`docker exec -it -u root fastdeploy bash` | ||
|
||
#### 1.2 安装(在docker内) | ||
|
||
`apt-get install build-essential python3-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev zlib1g-dev libsndfile1 language-pack-zh-hans wget zip` | ||
|
||
`pip3 install paddlespeech` | ||
|
||
`export LC_ALL="zh_CN.UTF-8"` | ||
|
||
`export LANG="zh_CN.UTF-8"` | ||
|
||
`export LANGUAGE="zh_CN:zh:en_US:en"` | ||
|
||
#### 1.3 下载模型(在docker内) | ||
|
||
HexToString marked this conversation as resolved.
Show resolved
Hide resolved
|
||
`cd /models/streaming_tts_serving/1` | ||
HexToString marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
`wget https://paddlespeech.bj.bcebos.com/Parakeet/released_models/fastspeech2/fastspeech2_cnndecoder_csmsc_streaming_onnx_1.0.0.zip` | ||
|
||
`wget https://paddlespeech.bj.bcebos.com/Parakeet/released_models/mb_melgan/mb_melgan_csmsc_onnx_0.2.0.zip` | ||
|
||
`unzip fastspeech2_cnndecoder_csmsc_streaming_onnx_1.0.0.zip` | ||
|
||
`unzip mb_melgan_csmsc_onnx_0.2.0.zip` | ||
|
||
#### 1.4 启动服务端(在docker内) | ||
|
||
`fastdeployserver --model-repository=/models --model-control-mode=explicit --load-model=streaming_tts_serving` | ||
|
||
**服务启动的默认端口是8000(for http),8001(for grpc),8002(for metrics). 如果想要改变服务的端口号,在上述命令后面添加以下参数即可`--http-port 9000 --grpc-port 9001 --metrics-port 9002`** | ||
HexToString marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### 2. 客户端 | ||
#### 2.1 安装 | ||
|
||
`pip3 install tritonclient[all]` | ||
|
||
#### 2.2 发送请求 | ||
|
||
`python3 /models/streaming_tts_serving/stream_client.py` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里也需要加一些传参说明,最好把待合成文本弄成参数 |
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.