Skip to content

Commit 3cf8e63

Browse files
fix generation
1 parent 9228ec6 commit 3cf8e63

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

local_notebooklm/steps/helpers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,24 +184,24 @@ def generate_speech(
184184
voice: str = "alloy",
185185
model_name: str = "tts-1",
186186
response_format: str = "wav",
187-
output_path: str = "output.mp3"
187+
output_path: str = "output"
188188
):
189189
if isinstance(client, ElevenLabs):
190-
client = ElevenLabs()
190+
print(client)
191191
audio = client.text_to_speech.convert(
192192
text=text,
193193
voice_id=voice,
194194
model_id=model_name,
195195
output_format=response_format,
196196
)
197-
save(audio=audio, filename=str(output_path))
197+
save(audio=audio, filename=str(f"{output_path}.{response_format}"))
198198
else:
199199
with client.audio.speech.with_streaming_response.create(
200200
model=model_name,
201201
voice=voice,
202202
input=text,
203203
response_format=response_format
204204
) as response:
205-
response.stream_to_file(str(output_path))
205+
response.stream_to_file(str(f"{output_path}.{response_format}"))
206206

207-
return output_path
207+
return f"{output_path}.{response_format}"

local_notebooklm/steps/step4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def generate_speaker_audio(
5656
) -> None:
5757
try:
5858
wait_for_next_step()
59-
generate_speaker_audio(client=client, model_name=model_name, text=text, output_path=output_path, voice=voice, response_format=response_format)
59+
generate_speech(client=client, model_name=model_name, text=text, output_path=output_path, voice=voice, response_format=response_format)
6060
except Exception as e:
6161
raise AudioGenerationError(f"Failed to generate audio: {str(e)}")
6262

test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
config_path="config.json",
66
format_type="summary",
77
length="short",
8-
style="academic",
9-
preference="Focus on the key technical aspects, this podcast shoudl only be for Machine Learning researchers and engineers.",
8+
style="normal",
9+
# preference="Focus on the key technical aspects, this podcast shoudl only be for Machine Learning researchers and engineers.",
1010
output_dir="./examples/test_output",
1111
skip_to=4
1212
)

0 commit comments

Comments
 (0)