fixed comments, test=doc

pull/1413/head
WilliamZhang06 3 years ago
parent c2eb9ad205
commit 88f9c818b2

@ -81,7 +81,6 @@ class ASRServerExecutor(ASRExecutor):
"""
audio_file = input
# logger.info("Preprocess audio_file:" + audio_file)
# Get the object for feature extraction
if "deepspeech2online" in model_type or "deepspeech2offline" in model_type:

@ -11,15 +11,18 @@
# 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.
from typing import Text
from engine.asr.python.asr_engine import ASREngine
from engine.tts.python.tts_engine import TTSEngine
__all__ = ['EngineFactory']
class EngineFactory(object):
@staticmethod
def get_engine(engine_name: str):
def get_engine(engine_name: Text):
if engine_name == 'asr':
return ASREngine()
elif engine_name == 'tts':

@ -42,7 +42,7 @@ def help():
"global": "success"
},
"result": {
"description": "tts server",
"description": "asr server",
"input": "base64 string of wavfile",
"output": "transcription"
}

Binary file not shown.

@ -14,10 +14,8 @@ import requests
import json
import time
import base64
import soundfile
import io
import argparse
def readwav2base64(wav_file):
"""
@ -29,7 +27,7 @@ def readwav2base64(wav_file):
return base64_string
def main(args):
def main():
"""
main func
"""
@ -58,9 +56,4 @@ def main(args):
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--model_type", action="store",
help="model type: u2, dp2", default="dp2")
args = parser.parse_args()
main(args)
main()

Loading…
Cancel
Save