Update subgen.py

This commit is contained in:
McCloudS
2023-11-04 12:01:54 -06:00
committed by GitHub
parent 1b86ef6d4f
commit 5bd8b57408

View File

@@ -72,6 +72,7 @@ path_mapping_to = os.getenv('PATH_MAPPING_TO', '/Volumes/TV')
model_location = os.getenv('MODEL_PATH', '.')
transcribe_folders = os.getenv('TRANSCRIBE_FOLDERS', '')
transcribe_or_translate = os.getenv('TRANSCRIBE_OR_TRANSLATE', 'translate')
compute_type = os.getenv('COMPUTE_TYPE', 'auto')
if transcribe_device == "gpu":
transcribe_device = "cuda"
@@ -228,7 +229,7 @@ def start_model():
global model
if model is None:
logging.debug("Model was purged, need to re-create")
model = stable_whisper.load_faster_whisper(whisper_model, download_root=model_location, device=transcribe_device, cpu_threads=whisper_threads, num_workers=concurrent_transcriptions)
model = stable_whisper.load_faster_whisper(whisper_model, download_root=model_location, device=transcribe_device, cpu_threads=whisper_threads, num_workers=concurrent_transcriptions, compute_type=compute_type)
def delete_model():
if len(files_to_transcribe) == 0: