We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d83d568 commit 0ee8d74Copy full SHA for 0ee8d74
open_dubbing/translation.py
@@ -130,7 +130,11 @@ def _add_translations(
130
stripped_translation = re.sub(
131
rf"^\s*{_BREAK_MARKER}\s*|\s*{_BREAK_MARKER}\s*$", "", translated_script
132
)
133
- text_segments = stripped_translation.split(_BREAK_MARKER)
+ if stripped_translation:
134
+ text_segments = stripped_translation.split(_BREAK_MARKER)
135
+ else:
136
+ text_segments = []
137
+
138
if len(utterance_metadata) != len(text_segments):
139
raise ValueError(
140
"The utterance metadata must be of the same length as the text"
0 commit comments