AttributeError: module 'whisper' has no attribute 'load_model'

Press CTRL+C to quit
XXXXXXXXXX - - [16/Jul/2023 17:07:24] "GET / HTTP/1.1" 200 -
Task exception was never retrieved
future: <Task finished name='Task-7' coro=<Dispatcher._process_polling_updates() done, defined at ....../venv/lib/python3.10/site-packages/aiogram/dispatcher/> exception=AttributeError("module 'whisper' has no attribute 'load_model'")>
Traceback (most recent call last):
  File "....../venv/lib/python3.10/site-packages/aiogram/dispatcher/", line 415, in _process_polling_updates
    for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)):
  File "....../venv/lib/python3.10/site-packages/aiogram/dispatcher/", line 235, in process_updates
    return await asyncio.gather(*tasks)
  File "....../venv/lib/python3.10/site-packages/aiogram/dispatcher/", line 117, in notify
    response = await handler_obj.handler(*args, **partial_data)
  File "....../venv/lib/python3.10/site-packages/aiogram/dispatcher/", line 256, in process_update
    return await self.message_handlers.notify(update.message)
  File "....../venv/lib/python3.10/site-packages/aiogram/dispatcher/", line 117, in notify
    response = await handler_obj.handler(*args, **partial_data)
  File "", line 162, in echo_msg
    lan, transcript = transcribe_from_audio_to_text("voice_message.ogg")
  File "....../", line 17, in transcribe_from_audio_to_text
    model = whisper.load_model("base")
AttributeError: module 'whisper' has no attribute 'load_model'

Happen to realize pip insall whisper only gives me the following files:

~/.../python3.10/site-packages$ ls -ld whisper*
drwxr-xr-x 1 runner runner   114 Jul 16 17:14 whisper-1.1.10.dist-info
-rw-r--r-- 1 runner runner 36864 Jul 16 17:14

However, on my local computer, I got a whisper folder:

âžś  site-packages ls -ld whisper*
drwxrwxr-x 5 lvision lvision  4096 Jul 14 18:16 whisper
drwxrwxr-x 2 lvision lvision  4096 Jul 16 00:16 whisper-1.1.10.dist-info
-rw-rw-r-- 1 lvision lvision 36864 Jul 16 00:16

Any suggestions? Why replit behave like that?

1 Like

What happens if you run poetry add whisper, then poetry install?

1 Like

Tried… Same result…
There is NO whisper subfolder.
maybe I just do a manuallyp copy and paste ?

Progress made. But now I’ve got this ERROR:

RuntimeError: "slow_conv2d_cpu" not implemented for 'Half'.

Hmm. Perhaps a pip install -U whisper will fix it? If not, maybe pip install --force-reinstall whisper?

1 Like

Nope… tried already…
pip install -U whisper also missing that whisper subfolder.
Now, I see the progress. But…
replit is clearly NOT as good as my local computer.

Problem solved by options = whisper.DecodingOptions(fp16 = False) .

Thank you everyone…

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.