Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我的funasr离线用不了,client-server #1751

Closed
851543 opened this issue May 23, 2024 · 6 comments
Closed

我的funasr离线用不了,client-server #1751

851543 opened this issue May 23, 2024 · 6 comments
Labels
question Further information is requested

Comments

@851543
Copy link

851543 commented May 23, 2024

server:
E:\FunASR\Test>python funasr_wss_server.py
model loading
2024-05-23 15:51:03,247 - modelscope - INFO - PyTorch version 2.3.0 Found.
2024-05-23 15:51:03,249 - modelscope - INFO - Loading ast index from E:\FunASR\modelscope\ast_indexer
2024-05-23 15:51:03,453 - modelscope - INFO - Loading done! Current index file version is 1.14.0, with md5 c554e3afd3d59e49236523ff934fdc29 and a total number of 976 components indexed
2024-05-23 15:51:03,894 - modelscope - INFO - Use user-specified model revision: v2.0.4
Downloading: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 19.1k/19.1k [00:00<00:00, 322kB/s]
ckpt: E:\FunASR\modelscope\iic\speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch\model.pt
2024-05-23 15:51:07,242 - modelscope - INFO - Use user-specified model revision: v2.0.4
ckpt: E:\FunASR\modelscope\iic\speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-online\model.pt
2024-05-23 15:51:10,432 - modelscope - INFO - Use user-specified model revision: v2.0.4
Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 8.45k/8.45k [00:00<?, ?B/s]
ckpt: E:\FunASR\modelscope\iic\speech_fsmn_vad_zh-cn-16k-common-pytorch\model.pt
2024-05-23 15:51:11,407 - modelscope - INFO - Use user-specified model revision: v2.0.4
ckpt: E:\FunASR\modelscope\iic\punc_ct-transformer_zh-cn-common-vad_realtime-vocab272727\model.pt
model loaded! only support one client at the same time now!!!!
E:\FunASR\Test\funasr_wss_server.py:329: DeprecationWarning: There is no current event loop
asyncio.get_event_loop().run_until_complete(start_server)
E:\FunASR\Test\funasr_wss_server.py:330: DeprecationWarning: There is no current event loop
asyncio.get_event_loop().run_forever()
new user connected
error in vad

client:
E:\FunASR\Test>python funasr_wss_client.py --host "127.0.0.1" --port 10095 --mode offline --audio_in "./data/test.mp4" --output_dir "./results"
Namespace(host='127.0.0.1', port=10095, chunk_size=[5, 10, 5], encoder_chunk_look_back=4, decoder_chunk_look_back=0, chunk_interval=10, hotword='', audio_in='./data/test.mp4', audio_fs=16000, send_without_sleep=True, thread_num=1, w
ords_max_print=10000, output_dir='./results', ssl=1, use_itn=1, mode='offline')
Namespace(host='127.0.0.1', port=10095, chunk_size=[5, 10, 5], encoder_chunk_look_back=4, decoder_chunk_look_back=0, chunk_interval=10, hotword='', audio_in='./data/test.mp4', audio_fs=16000, send_without_sleep=True, thread_num=1, w
ords_max_print=10000, output_dir='./results', ssl=1, use_itn=1, mode='offline')
connect to wss://127.0.0.1:10095

@851543 851543 added the question Further information is requested label May 23, 2024
@851543
Copy link
Author

851543 commented May 23, 2024

我尝试用wav文件去请求E:\FunASR\Test>python funasr_wss_client.py --host "127.0.0.1" --port 10095 --mode offline --audio_in "./data/test.wav" --output_dir "./results"
Namespace(host='127.0.0.1', port=10095, chunk_size=[5, 10, 5], encoder_chunk_look_back=4, decoder_chunk_look_back=0, chunk_interval=10, hotword='', audio_in='./data/test.wav', audio_fs=16000, send_without_sleep=True, thread_num=1, w
ords_max_print=10000, output_dir='./results', ssl=1, use_itn=1, mode='offline')
Namespace(host='127.0.0.1', port=10095, chunk_size=[5, 10, 5], encoder_chunk_look_back=4, decoder_chunk_look_back=0, chunk_interval=10, hotword='', audio_in='./data/test.wav', audio_fs=16000, send_without_sleep=True, thread_num=1, w
ords_max_print=10000, output_dir='./results', ssl=1, use_itn=1, mode='offline')
connect to wss://127.0.0.1:10095
server:
new user connected
error in vad
ConnectionClosed... {<websockets.legacy.server.WebSocketServerProtocol object at 0x000001AF69D815A0>}
ws reset now, total num is 1
new user connected

client久久不能响应 我的CPU拉满了 这个是什么问题。

@851543
Copy link
Author

851543 commented May 23, 2024

我尝试把funasr-client断了发现我的funasr-server还在运行把我的cpu拉满了

@851543
Copy link
Author

851543 commented May 23, 2024

HTML5哪里的实时可以使用,文件上传一直(发送完数据,请等候,正在识别...)

@851543
Copy link
Author

851543 commented May 23, 2024

我发才现这个文件的FunASR\runtime\python\websocket\funasr_wss_server.py的函数
async def async_vad(websocket, audio_in):

segments_result = model_vad.generate(input=audio_in, **websocket.status_dict_vad)[0]["value"]
print("deb"+segments_result)

speech_start = -1
speech_end = -1

if len(segments_result) == 0 or len(segments_result) > 1:
    return speech_start, speech_end
if segments_result[0][0] != -1:
    speech_start = segments_result[0][0]
if segments_result[0][1] != -1:
    speech_end = segments_result[0][1]
return speech_start, speech_end

segments_result 为一个[]一直死循环输出

@851543
Copy link
Author

851543 commented May 23, 2024

此外我发现html5交给funasr-server的热词没有效果。

@lyblsgo
Copy link
Collaborator

lyblsgo commented May 28, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants