McCloudS / subgen

Autogenerate subtitles using OpenAI Whisper Model via Jellyfin, Plex, Emby, Tautulli, or Bazarr
MIT License
453 stars 45 forks source link

NameError: name 'concurrent_transcriptions' is not defined #93

Closed benjroy closed 1 month ago

benjroy commented 1 month ago

Just restarted the subgen container and getting an error preventing the container from running:

# $ docker logs --follow -t subgen

2024-06-04T03:03:21.891759921Z 
2024-06-04T03:03:21.891804108Z ==========
2024-06-04T03:03:21.891898353Z == CUDA ==
2024-06-04T03:03:21.892594178Z ==========
2024-06-04T03:03:21.894766442Z 
2024-06-04T03:03:21.894778880Z CUDA Version 12.2.2
2024-06-04T03:03:21.895532789Z 
2024-06-04T03:03:21.895540903Z Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2024-06-04T03:03:21.896415694Z 
2024-06-04T03:03:21.896426806Z This container image and its contents are governed by the NVIDIA Deep Learning Container License.
2024-06-04T03:03:21.896431413Z By pulling and using the container, you accept the terms and conditions of this license:
2024-06-04T03:03:21.896435407Z https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license
2024-06-04T03:03:21.896439121Z 
2024-06-04T03:03:21.896442481Z A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.
2024-06-04T03:03:21.904592916Z 
2024-06-04T03:03:21.972829016Z Environment variables have been loaded from subgen.env
2024-06-04T03:03:21.972852255Z Downloading subgen.py from GitHub branch main...
2024-06-04T03:03:21.995022729Z File downloaded successfully to subgen.py
2024-06-04T03:03:21.995040559Z Launching subgen.py
2024-06-04T03:03:24.541104943Z Traceback (most recent call last):
2024-06-04T03:03:24.541124415Z   File "/subgen/subgen.py", line 138, in <module>
2024-06-04T03:03:24.541127259Z     for _ in range(concurrent_transcriptions):
2024-06-04T03:03:24.541129289Z NameError: name 'concurrent_transcriptions' is not defined
2024-06-04T03:03:24.907125282Z Traceback (most recent call last):
2024-06-04T03:03:24.907160941Z   File "/subgen/launcher.py", line 168, in <module>
2024-06-04T03:03:24.907252488Z     main()
2024-06-04T03:03:24.907264334Z   File "/subgen/launcher.py", line 163, in main
2024-06-04T03:03:24.907336453Z     subprocess.run([f'{python_cmd}', '-u', 'subgen.py'], check=True)
2024-06-04T03:03:24.907344129Z   File "/usr/lib/python3.10/subprocess.py", line 526, in run
2024-06-04T03:03:24.907547272Z     raise CalledProcessError(retcode, process.args,
2024-06-04T03:03:24.907553780Z subprocess.CalledProcessError: Command '['python3', '-u', 'subgen.py']' returned non-zero exit status 1.

I suspect that it it happening as a result of the latest commit because my initial setup was relying on env variables defined in my docker-compose.yml, then moved to a subgen.env file and relied on defaults for things i didn't want to override:

https://github.com/McCloudS/subgen/commit/2a7bf3edbd7cad10ed9b54ba1fbbd8cbd77c96bb

Does this seem plausible, that the removal of the update_env_variables() could have inadvertently removed the setting of expected defaults? Could the solution be to add CONCURRENT_TRANSCRIPTIONS=2 to my subgen.env file, or would I need to make sure to supply every env var with the documented default value in my subgen.env file?

For reference, here are the contents of my subgen.env file:

PLEXSERVER=http://__REDACTED__:32400
PLEX_TOKEN=__REDACTED__
DETECT_LANGUAGE_LENGTH=60
FORCE_DETECTED_LANGUAGE_TO=
WHISPER_MODEL=small
PROCADDEDMEDIA=True
PROCMEDIAONPLAY=True
DEBUG=False
TRANSCRIBE_DEVICE=gpu
TRANSCRIBE_OR_TRANSLATE=translate
CLEAR_VRAM_ON_COMPLETE=True
UPDATE=True
APPEND=True
USE_MODEL_PROMPT=False
CUSTOM_REGROUP=cm_sl=84_sl=42++++++1
PLEXTOKEN=__REDACTED__
Tyler-Jay-Stevahn commented 1 month ago

Undoing this commit seems to have fixed a similar issue for me.

https://github.com/McCloudS/subgen/commit/2a7bf3edbd7cad10ed9b54ba1fbbd8cbd77c96bb

McCloudS commented 1 month ago

Thanks all, I’ll revert it until I have more time to test it better.