Skip to content

Commit

Permalink
Update subgen.py
Browse files Browse the repository at this point in the history
  • Loading branch information
McCloudS authored Feb 9, 2024
1 parent 1606923 commit e2dd80e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion subgen/subgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def gen_subtitles(file_path: str, transcribe_or_translate_str: str, front=True)
logging.debug(f"{file_path} already has an internal sub we want, skipping generation")
return f"{file_path} already has an internal sub we want, skipping generation"
elif os.path.exists(get_file_name_without_extension(file_path) + subextension):
print(f"{file_path} already has a subgen created for this, skipping it")
logging.debug(f"{file_path} already has a subgen created for this, skipping it")
return f"{file_path} already has a subgen created for this, skipping it"

if front:
Expand All @@ -288,6 +288,7 @@ def gen_subtitles(file_path: str, transcribe_or_translate_str: str, front=True)
start_model()

if(force_detected_language_to):
logging.debug(f"Forcing detected audio language to {force_detected_language_to}")
result = model.transcribe_stable(file_path, language=force_detected_language_to, task=transcribe_or_translate_str)
else:
result = model.transcribe_stable(file_path, task=transcribe_or_translate_str)
Expand Down

0 comments on commit e2dd80e

Please sign in to comment.