Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -149,8 +149,6 @@ def generate_music(
|
|
149 |
|
150 |
genres = genre_txt.strip()
|
151 |
lyrics = split_lyrics(lyrics_txt + "\n")
|
152 |
-
print(lyrics)
|
153 |
-
print(len(lyrics))
|
154 |
# instruction
|
155 |
full_lyrics = "\n".join(lyrics)
|
156 |
prompt_texts = [f"Generate music from the given lyrics segment by segment.\n[Genre] {genres}\n{full_lyrics}"]
|
@@ -167,7 +165,7 @@ def generate_music(
|
|
167 |
end_of_segment = mmtokenizer.tokenize('[end_of_segment]')
|
168 |
|
169 |
# Format text prompt
|
170 |
-
run_n_segments = min(run_n_segments
|
171 |
|
172 |
print(list(enumerate(tqdm(prompt_texts[:run_n_segments]))))
|
173 |
|
|
|
149 |
|
150 |
genres = genre_txt.strip()
|
151 |
lyrics = split_lyrics(lyrics_txt + "\n")
|
|
|
|
|
152 |
# instruction
|
153 |
full_lyrics = "\n".join(lyrics)
|
154 |
prompt_texts = [f"Generate music from the given lyrics segment by segment.\n[Genre] {genres}\n{full_lyrics}"]
|
|
|
165 |
end_of_segment = mmtokenizer.tokenize('[end_of_segment]')
|
166 |
|
167 |
# Format text prompt
|
168 |
+
run_n_segments = min(run_n_segments, len(lyrics)) + 1
|
169 |
|
170 |
print(list(enumerate(tqdm(prompt_texts[:run_n_segments]))))
|
171 |
|