Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions manim_voiceover/services/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ def generate_from_text(
if not (0.25 <= speed <= 4.0):
raise ValueError("The speed must be between 0.25 and 4.0.")

instructions = kwargs.get('instructions', self.additional_kwargs.get('instructions'))

input_text = remove_bookmarks(text)
input_data = {
"input_text": input_text,
Expand All @@ -87,6 +89,7 @@ def generate_from_text(
"voice": self.voice,
"model": self.model,
"speed": speed,
"instructions": instructions,
},
}

Expand All @@ -107,6 +110,7 @@ def generate_from_text(
voice=self.voice,
input=input_text,
speed=speed,
instructions=instructions,
)
response.stream_to_file(str(Path(cache_dir) / audio_path))

Expand Down