Optimize subtitle generation in edge mode (#133)

This commit is contained in:
harry
2024-04-04 09:47:29 +08:00
parent fd81698f66
commit c5e396d484
3 changed files with 47 additions and 28 deletions

View File

@@ -96,11 +96,6 @@ def start(task_id, params: VideoParams):
if not os.path.exists(subtitle_path):
subtitle_fallback = True
logger.warning("subtitle file not found, fallback to whisper")
else:
subtitle_lines = subtitle.file_to_subtitles(subtitle_path)
if not subtitle_lines:
logger.warning(f"subtitle file is invalid, fallback to whisper : {subtitle_path}")
subtitle_fallback = True
if subtitle_provider == "whisper" or subtitle_fallback:
subtitle.create(audio_file=audio_file, subtitle_file=subtitle_path)