Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker-compose issue #29

Closed
notarobot63 opened this issue Nov 14, 2023 · 12 comments
Closed

Docker-compose issue #29

notarobot63 opened this issue Nov 14, 2023 · 12 comments

Comments

@notarobot63
Copy link

Hello,
The Docker build does not seems to end, Here are the last lines of the logs:

whisper has been successfully installed.

Traceback (most recent call last):

  File "/subgen/./subgen.py", line 40, in <module>

    import stable_whisper

ModuleNotFoundError: No module named 'stable_whisper'

Any idea ?

@McCloudS
Copy link
Owner

I don't... the Dockerfile currently builds fine and stable-ts is the package that needs 'import stable_whisper'. Are you building the dockerfile or pulling it from dockerhub (via docker-compose)? My only guess if you're building it yourself could be non-amd64 architecture throwing issues.

@notarobot63
Copy link
Author

notarobot63 commented Nov 14, 2023 via email

@McCloudS
Copy link
Owner

McCloudS commented Nov 14, 2023

That doesn't appear to be a dockerfile/docker-compose issue but an issue when the script is actually executed on start. For whatever reason, that implies that the installation of stable-ts is failing. You can try manually doing pip3 install stable-ts and see if it installs correctly. I pulled a fresh image and mine spins up immediately with no issue.

for package in packages_to_install:
installs all the packages necessary on script startup (packages listed starting at line 17).

@McCloudS
Copy link
Owner

McCloudS commented Nov 14, 2023

After thinking more... I would guess your python packages are being saved in the wrong place or something. If you have a similar line to - "{APPDATA}/subgen/dist-packages:/usr/local/lib/python3.10/dist-packages" in your docker-compose, I would remove it or make sure it actually maps to your configuration correctly.

The default docker-compose requires you to update paths to match your configuration.

@notarobot63
Copy link
Author

notarobot63 commented Nov 14, 2023 via email

@McCloudS
Copy link
Owner

Open up a bash/shell on the image and try manually installing the packages and see what's happening. You're failing on the first import of an installed package, which is either showing the install failed or it's not where it thinks it is.

@notarobot63
Copy link
Author

notarobot63 commented Nov 14, 2023 via email

@McCloudS
Copy link
Owner

Spun up the same image on a different machine, fresh install. No errors.

@notarobot63
Copy link
Author

notarobot63 commented Nov 15, 2023

That's really weird, I tried with cpu or latest branches still the same:
Here is the docker-compose if that can help:


version: '2'
services:
  subgen:
    container_name: subgen
    tty: true
    image: mccloud/subgen:latest
    environment:
       - "WHISPER_MODEL=medium"
       - "WHISPER_THREADS=4"
       - "PROCADDEDMEDIA=True"
       - "PROCMEDIAONPLAY=False"
       - "NAMESUBLANG=aa"
       - "SKIPIFINTERNALSUBLANG=fra"
       - "JELYFINTOKEN=token here"
       - "JELLYFINSERVER=http://jellyfin:8096"
       - "WEBHOOKPORT=8090"
       - "CONCURRENT_TRANSCRIPTIONS=2"
       - "WORD_LEVEL_HIGHLIGHT=False"
       - "DEBUG=True"
       - "USE_PATH_MAPPING=False"
       - "PATH_MAPPING_FROM=/tv"
       - "PATH_MAPPING_TO=/Volumes/TV"
       - "TRANSCRIBE_DEVICE=cpu"
       - "MODEL_PATH=."
    volumes:
       - "./tv:/tv"
    ports:
       - "8090:8090"

@McCloudS
Copy link
Owner

My last guess would be that your container doesn't have a valid network configuration and/or internet connection. So when it tries to download the packages, they all fail, and so it can't import them. You could troubleshoot by watching the output of the script run on container start, or getting a shell and trying to install the packages manually.

See: https://docs.docker.com/compose/networking/

@notarobot63
Copy link
Author

The container has Internet access and downloads the packages without problem.
Anyway I skipped the docker way and used the script straight from the VM and it works, I guess there's an issue with the docker images or whatever.
Great job anyway !

@McCloudS
Copy link
Owner

Thanks, just wish I knew what the problem was.  I use the container in a couple different places and it has just under 900 downloads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants