Merge pull request #77 from McCloudS/McCloudS-patch-1
Mc cloud s patch 1
This commit is contained in:
@@ -25,11 +25,13 @@ services:
|
|||||||
- "PATH_MAPPING_TO=/Volumes/TV"
|
- "PATH_MAPPING_TO=/Volumes/TV"
|
||||||
- "TRANSCRIBE_DEVICE=cpu"
|
- "TRANSCRIBE_DEVICE=cpu"
|
||||||
- "CLEAR_VRAM_ON_COMPLETE=True"
|
- "CLEAR_VRAM_ON_COMPLETE=True"
|
||||||
- "HF_TRANSFORMERS=False"
|
|
||||||
- "HF_BATCH_SIZE=24"
|
|
||||||
- "MODEL_PATH=./models"
|
- "MODEL_PATH=./models"
|
||||||
- "UPDATE=False"
|
- "UPDATE=False"
|
||||||
- "APPEND=False"
|
- "APPEND=False"
|
||||||
|
- "USE_MODEL_PROMPT=False"
|
||||||
|
- "CUSTOM_MODEL_PROMPT="
|
||||||
|
- "LRC_FOR_AUDIO_FILES=True"
|
||||||
|
- "CUSTOM_REGROUP=cm_sl=84_sl=42++++++1"
|
||||||
volumes:
|
volumes:
|
||||||
- "${TV}:/tv"
|
- "${TV}:/tv"
|
||||||
- "${MOVIES}:/movies"
|
- "${MOVIES}:/movies"
|
||||||
|
|||||||
12
subgen.py
12
subgen.py
@@ -24,6 +24,8 @@ import av
|
|||||||
import ffmpeg
|
import ffmpeg
|
||||||
import whisper
|
import whisper
|
||||||
import re
|
import re
|
||||||
|
from watchdog.observers.polling import PollingObserver as Observer
|
||||||
|
from watchdog.events import FileSystemEventHandler
|
||||||
|
|
||||||
def convert_to_bool(in_bool):
|
def convert_to_bool(in_bool):
|
||||||
# Convert the input to string and lower case, then check against true values
|
# Convert the input to string and lower case, then check against true values
|
||||||
@@ -60,6 +62,7 @@ def update_env_variables():
|
|||||||
global transcribe_folders, transcribe_or_translate, force_detected_language_to
|
global transcribe_folders, transcribe_or_translate, force_detected_language_to
|
||||||
global clear_vram_on_complete, compute_type, append, reload_script_on_change
|
global clear_vram_on_complete, compute_type, append, reload_script_on_change
|
||||||
global model_prompt, custom_model_prompt, lrc_for_audio_files, custom_regroup
|
global model_prompt, custom_model_prompt, lrc_for_audio_files, custom_regroup
|
||||||
|
global subextension, subextensionSDH
|
||||||
|
|
||||||
plextoken = os.getenv('PLEXTOKEN', 'token here')
|
plextoken = os.getenv('PLEXTOKEN', 'token here')
|
||||||
plexserver = os.getenv('PLEXSERVER', 'http://192.168.1.111:32400')
|
plexserver = os.getenv('PLEXSERVER', 'http://192.168.1.111:32400')
|
||||||
@@ -98,17 +101,14 @@ def update_env_variables():
|
|||||||
if transcribe_device == "gpu":
|
if transcribe_device == "gpu":
|
||||||
transcribe_device = "cuda"
|
transcribe_device = "cuda"
|
||||||
|
|
||||||
update_env_variables()
|
subextension = f".subgen.{whisper_model.split('.')[0]}.{namesublang}.srt"
|
||||||
|
subextensionSDH = f".subgen.{whisper_model.split('.')[0]}.{namesublang}.sdh.srt"
|
||||||
|
|
||||||
if monitor:
|
update_env_variables()
|
||||||
from watchdog.observers.polling import PollingObserver as Observer
|
|
||||||
from watchdog.events import FileSystemEventHandler
|
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
model = None
|
model = None
|
||||||
files_to_transcribe = []
|
files_to_transcribe = []
|
||||||
subextension = f".subgen.{whisper_model.split('.')[0]}.{namesublang}.srt"
|
|
||||||
subextensionSDH = f".subgen.{whisper_model.split('.')[0]}.{namesublang}.sdh.srt"
|
|
||||||
|
|
||||||
in_docker = os.path.exists('/.dockerenv')
|
in_docker = os.path.exists('/.dockerenv')
|
||||||
docker_status = "Docker" if in_docker else "Standalone"
|
docker_status = "Docker" if in_docker else "Standalone"
|
||||||
|
|||||||
Reference in New Issue
Block a user