shirayu/whispering

No ASR result return

xzdong-2019 opened this issue · 4 comments

hello,
When I deploy a service on windows and it has asr result, but there is no result on linux.
Can you take a look at it?

      command:
              whispering  --language en --model tiny --host 0.0.0.0 --port 8081 --debug
              whispering   --host 127.0.0.1 --port 8081 --no-vad --mode client
    
        linux bug log:
[2022-10-09 10:18:46,959] serve.serve_with_websocket_main:46 DEBUG -> Message size: 240000
[2022-10-09 10:18:46,959] transcriber.transcribe:236 DEBUG -> 60000
[2022-10-09 10:18:46,961] transcriber.transcribe:253 DEBUG -> Incoming new_mel.shape: torch.Size([80, 375])
[2022-10-09 10:18:46,961] transcriber.transcribe:257 DEBUG -> buffer_mel.shape: torch.Size([80, 2250])
[2022-10-09 10:18:46,963] transcriber.transcribe:260 DEBUG -> mel.shape: torch.Size([80, 2625])
[2022-10-09 10:18:46,963] transcriber.transcribe:264 DEBUG -> seek: 0
[2022-10-09 10:18:46,963] transcriber.transcribe:266 DEBUG -> mel.shape (2625) - seek (0) < N_FRAMES (3000)
[2022-10-09 10:18:46,963] transcriber.transcribe:272 DEBUG -> No padding
[2022-10-09 10:18:46,963] transcriber.transcribe:327 DEBUG -> ctx.buffer_mel.shape: torch.Size([80, 2625])
[2022-10-09 10:18:46,963] serve.serve_with_websocket_main:23 DEBUG -> Audio #: 7
[2022-10-09 10:18:50,711] protocol.read_frame:1152 DEBUG -> < BINARY 00 00 d0 3a 00 00 ec 3a 00 00 c0 3a 00 00 a4 3a ... 00 00 f0 b9 00 00 28 ba [240000 bytes]
[2022-10-09 10:18:50,711] serve.serve_with_websocket_main:46 DEBUG -> Message size: 240000
[2022-10-09 10:18:50,712] transcriber.transcribe:236 DEBUG -> 60000
[2022-10-09 10:18:50,714] transcriber.transcribe:253 DEBUG -> Incoming new_mel.shape: torch.Size([80, 375])
[2022-10-09 10:18:50,714] transcriber.transcribe:257 DEBUG -> buffer_mel.shape: torch.Size([80, 2625])
[2022-10-09 10:18:50,715] transcriber.transcribe:260 DEBUG -> mel.shape: torch.Size([80, 3000])
[2022-10-09 10:18:50,716] transcriber.transcribe:264 DEBUG -> seek: 0
[2022-10-09 10:18:50,735] transcriber.transcribe:281 DEBUG -> seek=0, timestamp=0.0, mel.shape: torch.Size([80, 3000]), segment.shape: torch.Size([80, 3000])
[2022-10-09 10:18:50,735] transcriber._decode_with_fallback:104 DEBUG -> DecodeOptions: DecodingOptions(task='transcribe', language='en', temperature=0.0, sample_len=None, best_of=None, beam_size=5, patience=None, length_penalty=None, prompt=[], prefix=None, suppress_blank=True, suppress_tokens='-1', without_timestamps=False, max_initial_timestamp=1.0, fp16=True)
[2022-10-09 10:18:50,735] server.handler:234 ERROR -> connection handler failed
Traceback (most recent call last):
  File "/root/anaconda3/envs/anio_whisper_webui/lib/python3.9/site-packages/websockets/legacy/server.py", line 232, in handler
    await self.ws_handler(self)
  File "/data/aino/code/whispering_flush/whispering/serve.py", line 57, in serve_with_websocket_main
    for chunk in g_wsp.transcribe(
  File "/data/aino/code/whispering_flush/whispering/transcriber.py", line 285, in transcribe
    result = self._decode_with_fallback(
  File "/data/aino/code/whispering_flush/whispering/transcriber.py", line 105, in _decode_with_fallback
    decode_result = self.model.decode(
  File "/root/anaconda3/envs/anio_whisper_webui/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/root/anaconda3/envs/anio_whisper_webui/lib/python3.9/site-packages/whisper/decoding.py", line 699, in decode
    result = DecodingTask(model, options).run(mel)
  File "/root/anaconda3/envs/anio_whisper_webui/lib/python3.9/site-packages/whisper/decoding.py", line 472, in __init__
    self.decoder = BeamSearchDecoder(
  File "/root/anaconda3/envs/anio_whisper_webui/lib/python3.9/site-packages/whisper/decoding.py", line 283, in __init__
    self.max_candidates: int = round(beam_size * (1.0 + patience))
TypeError: unsupported operand type(s) for +: 'float' and 'NoneType'  

Hello.
Which version are you using?
It seems that whispering is not the latest version.

Please install the latest version and try again.
https://github.com/shirayu/whispering#setup

hello,
I tried the method with the latest version, but not work.

Can you check /root/anaconda3/envs/anio_whisper_webui/lib/python3.9/site-packages/whisper/decoding.py ?
The following line does not exist in the expected Whisper (9e653bd0ea0f1e9493cb4939733e9de249493cfb).

        self.max_candidates: int = round(beam_size * (1.0 + patience))

The expected line is

        self.max_candidates: int = round(beam_size * self.patience)

In addition, it seems that you are using Anaconda, but there may be something wrong with the anaconda configuration.
(I have never used anaconda).
Please try without anaconda.

thanks, it does work.