McCloudS / subgen

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

Update subgen.py add queuing and threading. #85

Closed xhzhu0628 closed 3 months ago

xhzhu0628 commented 3 months ago

fix queuing .#51

McCloudS commented 3 months ago

Thanks, my issue has always been overthinking it and trying to get queueing to also work with ASR/Detect-language.

My limited testing shows it following the queueing nicely.

Take a look and let me know what you think. I added a check under gen_subtitles_queue so it won't queue something unless it actually needs to work on it.

If CONCURRENT_TRANSCRIPTIONS is 1, it will continually re-create the model on completion (not a huge deal, just a second wasted reloading the model and spamming the log).

Also, the files_to_transcribe needs to continue to exist in its current instantiation because that's what is used to 'internally' track the files being worked on so we don't accidentally delete/purge the model while we're working on it (primarily from the ASR and detect-language side because they don't call gen_subtitles) Fixed this in latest

If we can figure out how to queue up the ASR/Detect-language as well, that would be great (or at least be aware when they are running).

McCloudS commented 3 months ago

Sorry for spamming your branch, trying to make edits on my phone.