Spaces:
Running
on
Zero
Running
on
Zero
Zero GPU
Browse files
app.py
CHANGED
@@ -51,7 +51,7 @@ def infer_music(lrc, ref_audio_path, steps, max_frames=2048, device='cuda'):
|
|
51 |
|
52 |
def R1_infer1(theme, tags_gen, language):
|
53 |
try:
|
54 |
-
client = OpenAI(api_key=
|
55 |
|
56 |
llm_prompt = """
|
57 |
请围绕"{theme}"主题生成一首符合"{tags}"风格的完整歌词。生成的{language}语言的歌词。
|
@@ -66,7 +66,7 @@ def R1_infer1(theme, tags_gen, language):
|
|
66 |
"""
|
67 |
|
68 |
response = client.chat.completions.create(
|
69 |
-
model=
|
70 |
messages=[
|
71 |
{"role": "system", "content": "You are a professional musician who has been invited to make music-related comments."},
|
72 |
{"role": "user", "content": llm_prompt.format(theme=theme, tags=tags_gen, language=language)},
|
@@ -85,14 +85,14 @@ def R1_infer1(theme, tags_gen, language):
|
|
85 |
|
86 |
|
87 |
def R1_infer2(tags_lyrics, lyrics_input):
|
88 |
-
client = OpenAI(api_key=
|
89 |
|
90 |
llm_prompt = """
|
91 |
{lyrics_input}这是一首歌的歌词,每一行是一句歌词,{tags_lyrics}是我希望这首歌的风格,我现在想要给这首歌的每一句歌词打时间戳得到LRC,我希望时间戳分配应根据歌曲的标签、歌词的情感、节奏来合理推测,而非机械地按照歌词长度分配。第一句歌词的时间戳应考虑前奏长度,避免歌词从 `[00:00.00]` 直接开始。严格按照 LRC 格式输出歌词,每行格式为 `[mm:ss.xx]歌词内容`。最后的结果只输出LRC,不需要其他的解释。
|
92 |
"""
|
93 |
|
94 |
response = client.chat.completions.create(
|
95 |
-
model=
|
96 |
messages=[
|
97 |
{"role": "system", "content": "You are a professional musician who has been invited to make music-related comments."},
|
98 |
{"role": "user", "content": llm_prompt.format(lyrics_input=lyrics_input, tags_lyrics=tags_lyrics)},
|
@@ -191,9 +191,9 @@ with gr.Blocks(css=css) as demo:
|
|
191 |
|
192 |
gr.Examples(
|
193 |
examples=[
|
194 |
-
["./gift_of_the_world.wav"],
|
195 |
-
["./most_beautiful_expectation.wav"],
|
196 |
-
["./ltwyl.wav"]
|
197 |
],
|
198 |
inputs=[audio_prompt],
|
199 |
label="Audio Examples",
|
|
|
51 |
|
52 |
def R1_infer1(theme, tags_gen, language):
|
53 |
try:
|
54 |
+
client = OpenAI(api_key=os.getenv('DP_API'), base_url="https://api.deepseek.com")
|
55 |
|
56 |
llm_prompt = """
|
57 |
请围绕"{theme}"主题生成一首符合"{tags}"风格的完整歌词。生成的{language}语言的歌词。
|
|
|
66 |
"""
|
67 |
|
68 |
response = client.chat.completions.create(
|
69 |
+
model='deepseek-reasoner',
|
70 |
messages=[
|
71 |
{"role": "system", "content": "You are a professional musician who has been invited to make music-related comments."},
|
72 |
{"role": "user", "content": llm_prompt.format(theme=theme, tags=tags_gen, language=language)},
|
|
|
85 |
|
86 |
|
87 |
def R1_infer2(tags_lyrics, lyrics_input):
|
88 |
+
client = OpenAI(api_key=os.getenv('DP_API'), base_url="https://api.deepseek.com")
|
89 |
|
90 |
llm_prompt = """
|
91 |
{lyrics_input}这是一首歌的歌词,每一行是一句歌词,{tags_lyrics}是我希望这首歌的风格,我现在想要给这首歌的每一句歌词打时间戳得到LRC,我希望时间戳分配应根据歌曲的标签、歌词的情感、节奏来合理推测,而非机械地按照歌词长度分配。第一句歌词的时间戳应考虑前奏长度,避免歌词从 `[00:00.00]` 直接开始。严格按照 LRC 格式输出歌词,每行格式为 `[mm:ss.xx]歌词内容`。最后的结果只输出LRC,不需要其他的解释。
|
92 |
"""
|
93 |
|
94 |
response = client.chat.completions.create(
|
95 |
+
model='deepseek-reasoner',
|
96 |
messages=[
|
97 |
{"role": "system", "content": "You are a professional musician who has been invited to make music-related comments."},
|
98 |
{"role": "user", "content": llm_prompt.format(lyrics_input=lyrics_input, tags_lyrics=tags_lyrics)},
|
|
|
191 |
|
192 |
gr.Examples(
|
193 |
examples=[
|
194 |
+
["./prompt/gift_of_the_world.wav"],
|
195 |
+
["./prompt/most_beautiful_expectation.wav"],
|
196 |
+
["./prompt/ltwyl.wav"]
|
197 |
],
|
198 |
inputs=[audio_prompt],
|
199 |
label="Audio Examples",
|