未验证 提交 191e4c05 编写于 作者: H Hui Zhang 提交者: GitHub

Merge pull request #1800 from Honei/v0.3

[R1.0]update the streaming output and punc default ip, port
...@@ -353,8 +353,8 @@ class ASRClientExecutor(BaseExecutor): ...@@ -353,8 +353,8 @@ class ASRClientExecutor(BaseExecutor):
lang: str="zh_cn", lang: str="zh_cn",
audio_format: str="wav", audio_format: str="wav",
protocol: str="http", protocol: str="http",
punc_server_ip: str="127.0.0.1", punc_server_ip: str=None,
punc_server_port: int=8091): punc_server_port: int=None):
"""Python API to call an executor. """Python API to call an executor.
Args: Args:
...@@ -487,7 +487,6 @@ class TextClientExecutor(BaseExecutor): ...@@ -487,7 +487,6 @@ class TextClientExecutor(BaseExecutor):
input_ = args.input input_ = args.input
server_ip = args.server_ip server_ip = args.server_ip
port = args.port port = args.port
output = args.output
try: try:
time_start = time.time() time_start = time.time()
...@@ -522,4 +521,4 @@ class TextClientExecutor(BaseExecutor): ...@@ -522,4 +521,4 @@ class TextClientExecutor(BaseExecutor):
res = requests.post(url=url, data=json.dumps(request)) res = requests.post(url=url, data=json.dumps(request))
response_dict = res.json() response_dict = res.json()
punc_text = response_dict["result"]["punc_text"] punc_text = response_dict["result"]["punc_text"]
return punc_text return punc_text
\ No newline at end of file
...@@ -63,7 +63,7 @@ class TextHttpHandler: ...@@ -63,7 +63,7 @@ class TextHttpHandler:
response_dict = res.json() response_dict = res.json()
punc_text = response_dict["result"]["punc_text"] punc_text = response_dict["result"]["punc_text"]
except Exception as e: except Exception as e:
logger.error(f"Call punctuation {self.url} occurs") logger.error(f"Call punctuation {self.url} occurs error")
logger.error(e) logger.error(e)
punc_text = text punc_text = text
...@@ -176,7 +176,7 @@ class ASRWsAudioHandler: ...@@ -176,7 +176,7 @@ class ASRWsAudioHandler:
{ {
"name": "test.wav", "name": "test.wav",
"signal": "end", "signal": "end",
"nbest": 5 "nbest": 1
}, },
sort_keys=True, sort_keys=True,
indent=4, indent=4,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册