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 audio_file = input
# logger.info("Preprocess audio_file:" + audio_file)
# Get the object for feature extraction # Get the object for feature extraction
if "deepspeech2online" in model_type or "deepspeech2offline" in model_type: 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. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# 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.
from typing import Text
from engine.asr.python.asr_engine import ASREngine from engine.asr.python.asr_engine import ASREngine
from engine.tts.python.tts_engine import TTSEngine from engine.tts.python.tts_engine import TTSEngine
__all__ = ['EngineFactory'] __all__ = ['EngineFactory']
class EngineFactory(object): class EngineFactory(object):
@staticmethod @staticmethod
def get_engine(engine_name: str): def get_engine(engine_name: Text):
if engine_name == 'asr': if engine_name == 'asr':
return ASREngine() return ASREngine()
elif engine_name == 'tts': elif engine_name == 'tts':

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

Binary file not shown.

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

Loading…
Cancel
Save