Skip to content

Commit 0ee8d74

Browse files
committedJan 19, 2025
Fix
1 parent d83d568 commit 0ee8d74

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎open_dubbing/translation.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ def _add_translations(
130130
stripped_translation = re.sub(
131131
rf"^\s*{_BREAK_MARKER}\s*|\s*{_BREAK_MARKER}\s*$", "", translated_script
132132
)
133-
text_segments = stripped_translation.split(_BREAK_MARKER)
133+
if stripped_translation:
134+
text_segments = stripped_translation.split(_BREAK_MARKER)
135+
else:
136+
text_segments = []
137+
134138
if len(utterance_metadata) != len(text_segments):
135139
raise ValueError(
136140
"The utterance metadata must be of the same length as the text"

0 commit comments

Comments
 (0)