ahmetoner / whisper-asr-webservice

OpenAI Whisper ASR Webservice API
https://ahmetoner.github.io/whisper-asr-webservice
MIT License
1.86k stars 332 forks source link

v1.2.4 Docker hub image might be broken #172

Closed blundercode closed 7 months ago

blundercode commented 7 months ago

When running: docker run -it --gpus all -p 9000:9000 -e ASR_MODEL=large-v3 -e ASR_ENGINE=openai_whisper onerahmet/openai-whisper-asr-webservice:latest-gpu

It does not accept large-v3 as a parameter. And outputs this error:

Wrong index found for <|0.02|>: should be None but found 50366.
[2023-11-28 01:34:45 +0000] [8] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/app/.venv/lib/python3.10/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
    worker.init_process()
  File "/app/.venv/lib/python3.10/site-packages/uvicorn/workers.py", line 66, in init_process
    super(UvicornWorker, self).init_process()
  File "/app/.venv/lib/python3.10/site-packages/gunicorn/workers/base.py", line 134, in init_process
    self.load_wsgi()
  File "/app/.venv/lib/python3.10/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/app/.venv/lib/python3.10/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/app/.venv/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
    return self.load_wsgiapp()
  File "/app/.venv/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/app/.venv/lib/python3.10/site-packages/gunicorn/util.py", line 359, in import_app
    mod = importlib.import_module(module)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/app/app/webservice.py", line 65, in <module>
    whisper_model = whisper.load_model(whisper_model_name).cuda()
  File "/app/.venv/lib/python3.10/site-packages/whisper/__init__.py", line 112, in load_model
    raise RuntimeError(f"Model {name} not found; available models = {available_models()}")
RuntimeError: Model large-v3 not found; available models = ['tiny.en', 'tiny', 'base.en', 'base', 'small.en', 'small', 'medium.en', 'medium', 'large-v1', 'large-v2', 'large']
[2023-11-28 01:34:45 +0000] [8] [INFO] Worker exiting (pid: 8)
[2023-11-28 01:34:47 +0000] [7] [INFO] Shutting down: Master
[2023-11-28 01:34:47 +0000] [7] [INFO] Reason: Worker failed to boot.

When using just large it also appears to only be downloading v2 still and not v3.

Also would like to test the faster-whisper v3 integration but when I run the large-v3 option with faster_whisper it appears to only downloads the large-v2.pt

Thoughts? Am I running something incorrectly?

ayancey commented 7 months ago

Can you double check that the latest Docker image was used? If so, maybe a mistake was made when building and publishing the newest image. Scratch that, maybe an issue with the poetry lock?

You can always build the image yourself to test. I'll be doing this in a couple hours when I am home.

blundercode commented 7 months ago

Can you double check that the latest Docker image was used? If so, maybe a mistake was made when building and publishing the newest image.

You can always build the image yourself to test. I'll be doing this in a couple hours when I am home.

It does appear to be pulling from the latest I ran docker pull onerahmet/openai-whisper-asr-webservice says its on latest and also shouldnt onerahmet/openai-whisper-asr-webservice:latest-gpu part of the docker run command always reference the latest docker hub build?

Good idea I will give it a shot building myself now.

ayancey commented 7 months ago

also shouldnt onerahmet/openai-whisper-asr-webservice:latest-gpu part of the docker run command always reference the latest docker hub build?

Yep, just sanity checking. Sorry, this is wrong. Like Ahmet said, you need to pull the latest image every time you want to restart the container. Use docker pull or docker compose pull depending on which you're using.

blundercode commented 7 months ago

UPDATE:

Building the image locally from the GitHub repo worked for me!

Maybe its something wrong with the docker hub image?

Excited to test out V3 stuff!

ahmetoner commented 7 months ago

@blundercode please ensure that you pull the image before running the command; otherwise, it will run the cached image that you pulled previously.

docker pull onerahmet/openai-whisper-asr-webservice:latest-gpu
blundercode commented 7 months ago

@ahmetoner

Alright that fixed it I was running docker pull onerahmet/openai-whisper-asr-webservice I guess I needed the :latest-gpu tag on the end of it good know. My bad sorry for the false alarm!

I was just using the default docker pull onerahmet/openai-whisper-asr-webservice command on the dockerhub. Might be worth updating the docs to idiot-proof it so people like me don't bother you haha

Thanks for the updates and quick responses from both of you