move dir, test=doc

pull/1454/head
lym0302 3 years ago
parent 79c064fe21
commit 76391275fc

@ -0,0 +1,25 @@
# PaddleSpeech Server
## The environment variables
The path.sh contains the environment variable.
```bash
source ./bin/path.sh
```
## Add engine_backend on conf/application.yaml
```
engine_backend:
asr: 'conf/asr/asr.yaml'
[server name]: [conf yaml file]
```
Currently supporting asr and tts services.
## Start service(command line todo)
```bash
python ./bin/main.py
```
## Client access
Refer to `../tests`

@ -12,13 +12,12 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import argparse import argparse
import uvicorn import uvicorn
import yaml import yaml
from engine.engine_factory import EngineFactory
from fastapi import FastAPI from fastapi import FastAPI
from restful.api import setup_router
from engine.engine_factory import EngineFactory
from restful.api import setup_router
from utils.config import get_config from utils.config import get_config
from utils.log import logger from utils.log import logger

@ -0,0 +1,3 @@
export MAIN_ROOT=`realpath ${PWD}/../`
export PYTHONIOENCODING=UTF-8
export PYTHONPATH=${MAIN_ROOT}:${PYTHONPATH}

@ -12,6 +12,6 @@ port: 8090
# add engine type (Options: asr, tts) and config file here. # add engine type (Options: asr, tts) and config file here.
engine_backend: engine_backend:
asr: 'conf/asr/asr.yaml' #asr: 'conf/asr/asr.yaml'
tts: 'conf/tts/tts.yaml' tts: 'conf/tts/tts.yaml'

@ -339,7 +339,7 @@ class TTSEngine(BaseEngine):
""" """
super(TTSEngine, self).__init__() super(TTSEngine, self).__init__()
def init(self, config_file: str): def init(self, config_file: str) -> bool:
self.executor = TTSServerExecutor() self.executor = TTSServerExecutor()
self.config_file = config_file self.config_file = config_file
self.config = get_config(config_file) self.config = get_config(config_file)
@ -361,6 +361,7 @@ class TTSEngine(BaseEngine):
voc_predictor_conf=self.config.voc_predictor_conf, ) voc_predictor_conf=self.config.voc_predictor_conf, )
logger.info("Initialize TTS server engine successfully.") logger.info("Initialize TTS server engine successfully.")
return True
def postprocess(self, def postprocess(self,
wav, wav,

@ -48,7 +48,7 @@ class TTSEngine(BaseEngine):
""" """
super(TTSEngine, self).__init__() super(TTSEngine, self).__init__()
def init(self, config_file: str): def init(self, config_file: str) -> bool:
self.executor = TTSServerExecutor() self.executor = TTSServerExecutor()
self.config_file = config_file self.config_file = config_file
self.config = get_config(config_file) self.config = get_config(config_file)
@ -68,6 +68,7 @@ class TTSEngine(BaseEngine):
lang=self.config.lang) lang=self.config.lang)
logger.info("Initialize TTS server engine successfully.") logger.info("Initialize TTS server engine successfully.")
return True
def postprocess(self, def postprocess(self,
wav, wav,

@ -1,13 +0,0 @@
# Copyright (c) 2022 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.
Loading…
Cancel
Save