ggerganov / whisper.cpp

Port of OpenAI's Whisper model in C/C++
MIT License
34.5k stars 3.52k forks source link

No response while building CoreML model. #1182

Open jiaobenhaimo opened 1 year ago

jiaobenhaimo commented 1 year ago

Hello. I am using a M1 MacBook Pro with python 3.10.12 installed with pyenv in zsh. I was attempting to build CoreML "large" model, and after starting the script, it output this.

whoami@MacBook-Pro whisper.cpp % ./models/generate-coreml-model.sh large
${Home}/.pyenv/versions/3.10.12/lib/python3.10/site-packages/whisper/timing.py:58: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.
  def backtrace(trace: np.ndarray):
ModelDimensions(n_mels=80, n_audio_ctx=1500, n_audio_state=1280, n_audio_head=20, n_audio_layer=32, n_vocab=51865, n_text_ctx=448, n_text_state=1280, n_text_head=20, n_text_layer=32)
${Home}/.pyenv/versions/3.10.12/lib/python3.10/site-packages/whisper/model.py:166: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
  assert x.shape[1:] == self.positional_embedding.shape, "incorrect audio shape"
${Home}/.pyenv/versions/3.10.12/lib/python3.10/site-packages/whisper/model.py:97: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
  scale = (n_state // self.n_head) ** -0.25
Converting PyTorch Frontend ==> MIL Ops: 100%|████████████████████████████████████████████████████████████████████████████████████████████▉| 2611/2612 [00:02<00:00, 986.58 ops/s]
Running MIL frontend_pytorch pipeline: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 31.53 passes/s]
Running MIL default pipeline: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████| 57/57 [00:24<00:00,  2.34 passes/s]
Running MIL backend_mlprogram pipeline: 100%|███████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 259.73 passes/s]

After this, the command line stays the same for tens of hours and outputs nothing more. What problems might I been experiencing?

gglanzani commented 1 year ago

See https://github.com/ggerganov/whisper.cpp/issues/1119

Sogl commented 1 year ago

I have the same problem on Macbook Air M1, the process with large model has been going on for over 10 hours and still no results. In the processes I see only aned with 100% CPU loading.

@jiaobenhaimo Were you able to convert the model?

Sogl commented 1 year ago

Found a solution:: https://github.com/ggerganov/whisper.cpp/issues/773#issuecomment-1722175266