安装前请安装miniconda环境,不会的请参考上一篇文章
创建环境:
1、创建paddlespeech 虚拟环境
conda create -n paddlespeech python=3.8
2、初始化
conda init
3、激活
conda activate
4、进入环境
conda activate paddlespeech
安装源码:
git clone -b r1.2 https://gitee.com/paddlepaddle/PaddleSpeech
安装依赖:
切换到git 下来的paddlespeech源码地址:
cd PaddleSpeech
pip install pytest-runner -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install . -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install uvicorn==0.18.3
为防止后面启动报错我又安装了一个paddlepaddle
pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple
这是错误提示:
服务配置:
这里Server开启哪些服务,主要是由/home/aistudio/PaddleSpeech/paddlespeech/server/conf/application.yaml
文件控制,这里先带大家一起解读这个文件。host: 0.0.0.0 port: 8090
#The task format in the engin_list is: _
#task choices = [‘asr_python’, ‘asr_inference’, ‘tts_python’, ‘tts_inference’, ‘cls_python’, ‘cls_inference’] protocol: ‘http’
engine_list: [‘asr_python’, ‘tts_python’, ‘cls_python’, ‘text_python’,
‘vector_python’]host定义的是主机的网络服务信息 port开启8090端口 protocol定义了协议类型为http
engine_list表示开启了哪些服务类型,我们可以看到开启了asr(语音识别),tts(语音合成),cls(声音分类),text(标点恢复),vector(声纹向量提取)
如果我们只想开启其中某个服务,只需修改engine_list配置参数,只保留对应项即可
启动服务:
如果需要修改上面的配置需要修改 PaddleSpeech\paddlespeech\server\conf\application.yaml
以下文件
在PaddleSpeech\demos\speech_server下执行:
paddlespeech_server start --config_file ./conf/application.yaml