Skip to content

Commit

Permalink
fix SUNO prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielchua committed Sep 30, 2024
1 parent 8ddd281 commit 112bea7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
36 changes: 18 additions & 18 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

# Local imports
from prompts import SYSTEM_PROMPT
from utils import generate_script, generate_audio, parse_url
from utils import generate_script, generate_podcast_audio, parse_url

LANGUAGE_MAPPING = {
"English": "en",
Expand Down Expand Up @@ -153,7 +153,7 @@ def generate_podcast(
total_characters += len(line.text)

# Get audio file path
audio_file_path = generate_audio(
audio_file_path = generate_podcast_audio(
line.text, line.speaker, LANGUAGE_MAPPING[language]
)
# Read the audio file into an AudioSegment
Expand Down Expand Up @@ -243,22 +243,22 @@ def generate_podcast(
"Short (1-2 min)",
"English",
],
[
[],
"https://en.wikipedia.org/wiki/Hugging_Face",
"How did Hugging Face become so successful?",
"Fun",
"Short (1-2 min)",
"English",
],
[
[],
"https://simple.wikipedia.org/wiki/Taylor_Swift",
"Why is Taylor Swift so popular?",
"Fun",
"Short (1-2 min)",
"English",
],
# [
# [],
# "https://en.wikipedia.org/wiki/Hugging_Face",
# "How did Hugging Face become so successful?",
# "Fun",
# "Short (1-2 min)",
# "English",
# ],
# [
# [],
# "https://simple.wikipedia.org/wiki/Taylor_Swift",
# "Why is Taylor Swift so popular?",
# "Fun",
# "Short (1-2 min)",
# "English",
# ],
],
cache_examples=True,
)
Expand Down
2 changes: 1 addition & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def parse_url(url: str) -> str:
return response.text


def generate_audio(text: str, speaker: str, language: str) -> str:
def generate_podcast_audio(text: str, speaker: str, language: str) -> str:

audio_array = generate_audio(text, history_prompt=f"v2/{language}_speaker_{'1' if speaker == 'Host (Jane)' else '3'}")

Expand Down

0 comments on commit 112bea7

Please sign in to comment.