未验证 提交 b0b3222f 编写于 作者: 小湉湉's avatar 小湉湉 提交者: GitHub

Merge pull request #2213 from yt605155624/fix_name_bug

[server]fix readme, test=doc
此差异已折叠。
此差异已折叠。
......@@ -550,11 +550,9 @@ class CLSClientExecutor(BaseExecutor):
"""
Python API to call an executor.
"""
url = 'http://' + server_ip + ":" + str(port) + '/paddlespeech/cls'
audio = wav2base64(input)
data = {"audio": audio, "topk": topk}
res = requests.post(url=url, data=json.dumps(data))
return res
......@@ -679,6 +677,7 @@ class VectorClientExecutor(BaseExecutor):
test_audio=args.test,
task=task)
time_end = time.time()
logger.info(res.json())
logger.info("Response time %f s." % (time_end - time_start))
return True
except Exception as e:
......@@ -718,7 +717,6 @@ class VectorClientExecutor(BaseExecutor):
logger.info(f"the input audio: {input}")
handler = VectorHttpHandler(server_ip=server_ip, port=port)
res = handler.run(input, audio_format, sample_rate)
logger.info(f"The spk embedding is: {res}")
return res
elif task == "score":
from paddlespeech.server.utils.audio_handler import VectorScoreHttpHandler
......@@ -728,7 +726,6 @@ class VectorClientExecutor(BaseExecutor):
handler = VectorScoreHttpHandler(server_ip=server_ip, port=port)
res = handler.run(enroll_audio, test_audio, audio_format,
sample_rate)
logger.info(f"The vector score is: {res}")
return res
else:
logger.error(f"Sorry, we have not support such task {task}")
......
......@@ -554,7 +554,7 @@ class VectorHttpHandler:
res = requests.post(url=self.url, data=json.dumps(data))
return res.json()
return res
class VectorScoreHttpHandler:
......@@ -602,4 +602,4 @@ class VectorScoreHttpHandler:
res = requests.post(url=self.url, data=json.dumps(data))
return res.json()
return res
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册