提交 88f9c818 编写于 作者: W WilliamZhang06

fixed comments, test=doc

上级 c2eb9ad2
......@@ -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"
}
......
......@@ -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()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册