collabora / WhisperLive

A nearly-live implementation of OpenAI's Whisper.
MIT License
2.1k stars 286 forks source link

Required inputs (['state']) are missing from input feed #255

Closed nullonesix closed 4 months ago

nullonesix commented 4 months ago

when running the default tensorRT server and making a client query, i get the following error:

[07/08/2024-07:19:09] Unexpected error: Required inputs (['state']) are missing from input feed (['input', 'h', 'c', 'sr']).

my client looks like:

from whisper_live.client import TranscriptionClient
client = TranscriptionClient(
  "199.204.135.78",
  9091,
  lang="en",
  translate=False,
#   model="small",
#   use_vad=False,
#   save_output_recording=True,                         # Only used for microphone input, False by Default
#   output_recording_filename="./output_recording.wav"  # Only used for microphone input
)
client()
nullonesix commented 4 months ago

and then if i try to use the default faster whisper i get:

INFO:root:Single model mode currently only works with custom models. INFO:websockets.server:connection open INFO:root:New client connected ERROR:root:Error during new connection initialization: 'model'

asr-lord commented 4 months ago

You have to change VAD downloand link in vad.py: https://github.com/collabora/WhisperLive/issues/249#issuecomment-2207857559

#Actual
def download(model_url="https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx"):
#New
def download(model_url="https://github.com/snakers4/silero-vad/raw/v4.0/files/silero_vad.onnx"):
nullonesix commented 4 months ago

You have to change VAD downloand link in vad.py: #249 (comment)

#Actual
def download(model_url="https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx"):
#New
def download(model_url="https://github.com/snakers4/silero-vad/raw/v4.0/files/silero_vad.onnx"):

i tried this and i get the same error:

root@f341103f07e9:/app# python3 run_server.py --port 9092 \
                      --backend tensorrt \
                      --trt_model_path "/app/TensorRT-LLM-examples/whisper/whisper_small_en"
[TensorRT-LLM] TensorRT-LLM version: 0.9.0
--2024-07-08 14:11:22--  https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx
Resolving github.com (github.com)... 140.82.113.4
Connecting to github.com (github.com)|140.82.113.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.githubusercontent.com/snakers4/silero-vad/master/files/silero_vad.onnx [following]
--2024-07-08 14:11:22--  https://raw.githubusercontent.com/snakers4/silero-vad/master/files/silero_vad.onnx
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.110.133, 185.199.108.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2313101 (2.2M) [application/octet-stream]
Saving to: ‘/root/.cache/whisper-live/silero_vad.onnx’

/root/.cache/whisper-live/sil 100%[=================================================>]   2.21M  --.-KB/s    in 0.02s

2024-07-08 14:11:22 (103 MB/s) - ‘/root/.cache/whisper-live/silero_vad.onnx’ saved [2313101/2313101]

/app/whisper_live/vad.py:141: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:206.)
  speech_prob = self.model(torch.from_numpy(audio_frame), self.frame_rate).item()
[07/08/2024-14:11:26] Unexpected error: Required inputs (['state']) are missing from input feed (['input', 'h', 'c', 'sr']).
asr-lord commented 4 months ago

You have to change VAD downloand link in vad.py: #249 (comment)

#Actual
def download(model_url="https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx"):
#New
def download(model_url="https://github.com/snakers4/silero-vad/raw/v4.0/files/silero_vad.onnx"):

i tried this and i get the same error:

root@f341103f07e9:/app# python3 run_server.py --port 9092 \
                      --backend tensorrt \
                      --trt_model_path "/app/TensorRT-LLM-examples/whisper/whisper_small_en"
[TensorRT-LLM] TensorRT-LLM version: 0.9.0
--2024-07-08 14:11:22--  https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx
Resolving github.com (github.com)... 140.82.113.4
Connecting to github.com (github.com)|140.82.113.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.githubusercontent.com/snakers4/silero-vad/master/files/silero_vad.onnx [following]
--2024-07-08 14:11:22--  https://raw.githubusercontent.com/snakers4/silero-vad/master/files/silero_vad.onnx
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.110.133, 185.199.108.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2313101 (2.2M) [application/octet-stream]
Saving to: ‘/root/.cache/whisper-live/silero_vad.onnx’

/root/.cache/whisper-live/sil 100%[=================================================>]   2.21M  --.-KB/s    in 0.02s

2024-07-08 14:11:22 (103 MB/s) - ‘/root/.cache/whisper-live/silero_vad.onnx’ saved [2313101/2313101]

/app/whisper_live/vad.py:141: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:206.)
  speech_prob = self.model(torch.from_numpy(audio_frame), self.frame_rate).item()
[07/08/2024-14:11:26] Unexpected error: Required inputs (['state']) are missing from input feed (['input', 'h', 'c', 'sr']).

In the log it seems that you are still using old link:

HTTP request sent, awaiting response... 302 Found
Location: https://raw.githubusercontent.com/snakers4/silero-vad/master/files/silero_vad.onnx [following]
HuangMason320 commented 4 months ago

I think this might be error on the vad.py in the docker. But i can't modify the code i get from docker image.

nullonesix commented 4 months ago

just install vim and modify the link, mb i forgot i was in a docker container

makaveli10 commented 4 months ago

Closed by https://github.com/collabora/WhisperLive/pull/247