parent
42cbe313c2
commit
b508c4d0cb
@ -0,0 +1,33 @@
|
|||||||
|
# PaddleSpeech Server Command Line
|
||||||
|
|
||||||
|
([简体中文](./README_cn.md)|English)
|
||||||
|
|
||||||
|
The simplest approach to use PaddleSpeech Server including server and client.
|
||||||
|
|
||||||
|
## PaddleSpeech Server
|
||||||
|
### Help
|
||||||
|
```bash
|
||||||
|
paddlespeech_server help
|
||||||
|
```
|
||||||
|
### Start the server
|
||||||
|
First set the service-related configuration parameters, similar to `./conf/application.yaml`,
|
||||||
|
Then start the service:
|
||||||
|
```bash
|
||||||
|
paddlespeech_server start --config_file ./conf/application.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
## PaddleSpeech Client
|
||||||
|
### Help
|
||||||
|
```bash
|
||||||
|
paddlespeech_client help
|
||||||
|
```
|
||||||
|
### Access speech recognition services
|
||||||
|
```
|
||||||
|
paddlespeech_client asr --server_ip 127.0.0.1 --port 8090 --input ./tests/16_audio.wav
|
||||||
|
```
|
||||||
|
|
||||||
|
### Access text to speech services
|
||||||
|
```bash
|
||||||
|
paddlespeech_client tts --server_ip 127.0.0.1 --port 8090 --input "你好,欢迎使用百度飞桨深度学习框架!" --output output.wav
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,32 @@
|
|||||||
|
# PaddleSpeech Server 命令行工具
|
||||||
|
|
||||||
|
(简体中文|[English](./README.md))
|
||||||
|
|
||||||
|
它提供了最简便的方式调用 PaddleSpeech 语音服务用一行命令就可以轻松启动服务和调用服务。
|
||||||
|
|
||||||
|
## 服务端命令行使用
|
||||||
|
### 帮助
|
||||||
|
```bash
|
||||||
|
paddlespeech_server help
|
||||||
|
```
|
||||||
|
### 启动服务
|
||||||
|
首先设置服务相关配置文件,类似于 `./conf/application.yaml`,同时设置服务配置中的语音任务模型相关配置,类似于 `./conf/tts/tts.yaml`。
|
||||||
|
然后启动服务:
|
||||||
|
```bash
|
||||||
|
paddlespeech_server start --config_file ./conf/application.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
## 客户端命令行使用
|
||||||
|
### 帮助
|
||||||
|
```bash
|
||||||
|
paddlespeech_client help
|
||||||
|
```
|
||||||
|
### 访问语音识别服务
|
||||||
|
```
|
||||||
|
paddlespeech_client asr --server_ip 127.0.0.1 --port 8090 --input input_16k.wav
|
||||||
|
```
|
||||||
|
|
||||||
|
### 访问语音合成服务
|
||||||
|
```bash
|
||||||
|
paddlespeech_client tts --server_ip 127.0.0.1 --port 8090 --input "你好,欢迎使用百度飞桨深度学习框架!" --output output.wav
|
||||||
|
```
|
@ -0,0 +1,38 @@
|
|||||||
|
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
import argparse
|
||||||
|
from abc import ABC
|
||||||
|
from abc import abstractmethod
|
||||||
|
from typing import List
|
||||||
|
|
||||||
|
class BaseExecutor(ABC):
|
||||||
|
"""
|
||||||
|
An abstract executor of paddlespeech server tasks.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.parser = argparse.ArgumentParser()
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def execute(self, argv: List[str]) -> bool:
|
||||||
|
"""
|
||||||
|
Command line entry. This method can only be accessed by a command line such as `paddlespeech asr`.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
argv (List[str]): Arguments from command line.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: Result of the command execution. `True` for a success and `False` for a failure.
|
||||||
|
"""
|
||||||
|
pass
|
Loading…
Reference in new issue