Spaces:
Running
on
L40S
Running
on
L40S
Update simpler_app.py
Browse files- simpler_app.py +7 -8
simpler_app.py
CHANGED
@@ -62,24 +62,23 @@ pipe = pipeline("text-generation", model=zephyr_model, torch_dtype=torch.bfloat1
|
|
62 |
|
63 |
def prepare_lyrics_with_llm(theme, tags, lyrics):
|
64 |
|
65 |
-
language = "
|
66 |
standard_sys = f"""
|
67 |
-
Please generate a complete song with lyrics in {language}, following the {tags} style and centered around the theme "{theme}".
|
68 |
-
If {lyrics} is provided, format it accordingly.
|
69 |
-
If {lyrics} is None, generate original lyrics based on the given theme and style.
|
70 |
-
|
71 |
-
Strictly adhere to the following requirements:
|
72 |
|
73 |
### Mandatory Formatting Rules
|
74 |
1. Only output the formatted lyrics—do not include any explanations, introductions, or additional messages.
|
75 |
2. Only include timestamps and lyrics. Do not use brackets, side notes, or section markers (e.g., chorus, instrumental, outro).
|
76 |
-
3. Each line must
|
77 |
4. The total song length must not exceed 1 minute 30 seconds.
|
78 |
-
5. Timestamps should be naturally distributed. The first lyric must not start at [00:00.00]
|
|
|
|
|
79 |
|
80 |
### Prohibited Examples (Do Not Include)
|
81 |
- Incorrect: [01:30.00](Piano solo)
|
82 |
- Incorrect: [00:45.00][Chorus]
|
|
|
83 |
"""
|
84 |
|
85 |
instruction = f"""
|
|
|
62 |
|
63 |
def prepare_lyrics_with_llm(theme, tags, lyrics):
|
64 |
|
65 |
+
language = "en"
|
66 |
standard_sys = f"""
|
67 |
+
Please generate a complete song with lyrics in {language}, following the {tags} style and centered around the theme "{theme}". If {lyrics} is provided, format it accordingly. If {lyrics} is None, generate original lyrics based on the given theme and style. Strictly adhere to the following requirements:
|
|
|
|
|
|
|
|
|
68 |
|
69 |
### Mandatory Formatting Rules
|
70 |
1. Only output the formatted lyrics—do not include any explanations, introductions, or additional messages.
|
71 |
2. Only include timestamps and lyrics. Do not use brackets, side notes, or section markers (e.g., chorus, instrumental, outro).
|
72 |
+
3. **Each line must start with a timestamp**, following the format [mm:ss.xx]Lyrics content, with no spaces between the timestamp and lyrics. The lyrics should be continuous and complete.
|
73 |
4. The total song length must not exceed 1 minute 30 seconds.
|
74 |
+
5. Timestamps should be naturally distributed. **The first lyric must not start at [00:00.00]**—there should always be an intro with no lyrics, and the first lyric should start around 8 to 10 seconds into the song. Do not start timestamps at [00:00.00].
|
75 |
+
6. The intro time should always be left blank (with no lyrics) before the first lyric, ensuring the song naturally begins after an intro section.
|
76 |
+
7. **Every single line must begin with a timestamp.** No line should be missing a timestamp.
|
77 |
|
78 |
### Prohibited Examples (Do Not Include)
|
79 |
- Incorrect: [01:30.00](Piano solo)
|
80 |
- Incorrect: [00:45.00][Chorus]
|
81 |
+
- Incorrect: Lyrics without a timestamp at the beginning of the line.
|
82 |
"""
|
83 |
|
84 |
instruction = f"""
|