Spaces:
Running
Running
Update a.py
Browse files
a.py
CHANGED
|
@@ -154,7 +154,7 @@ def generate_song_from_text(lyrics_text, style, title, instrumental, model):
|
|
| 154 |
if model == "V4" and len(lyrics_text) > 3000:
|
| 155 |
lyrics_text = lyrics_text[:3000]
|
| 156 |
yield f"⚠️ Lyrics truncated to 3000 characters for V4 model\n\n"
|
| 157 |
-
elif model in ["V4_5", "V4_5PLUS", "V4_5ALL", "V5"] and len(lyrics_text) > 5000:
|
| 158 |
lyrics_text = lyrics_text[:5000]
|
| 159 |
yield f"⚠️ Lyrics truncated to 5000 characters for {model} model\n\n"
|
| 160 |
|
|
@@ -166,7 +166,7 @@ def generate_song_from_text(lyrics_text, style, title, instrumental, model):
|
|
| 166 |
if model == "V4" and len(style) > 200:
|
| 167 |
style = style[:200]
|
| 168 |
yield f"⚠️ Style truncated to 200 characters for V4 model\n\n"
|
| 169 |
-
elif model in ["V4_5", "V4_5PLUS", "V4_5ALL", "V5"] and len(style) > 1000:
|
| 170 |
style = style[:1000]
|
| 171 |
yield f"⚠️ Style truncated to 1000 characters for {model} model\n\n"
|
| 172 |
|
|
@@ -174,7 +174,7 @@ def generate_song_from_text(lyrics_text, style, title, instrumental, model):
|
|
| 174 |
if model in ["V4", "V4_5ALL"] and len(title) > 80:
|
| 175 |
title = title[:80]
|
| 176 |
yield f"⚠️ Title truncated to 80 characters for {model} model\n\n"
|
| 177 |
-
elif model in ["V4_5", "V4_5PLUS", "V5"] and len(title) > 100:
|
| 178 |
title = title[:100]
|
| 179 |
yield f"⚠️ Title truncated to 100 characters for {model} model\n\n"
|
| 180 |
|
|
@@ -360,8 +360,8 @@ with gr.Blocks() as app:
|
|
| 360 |
)
|
| 361 |
model = gr.Dropdown(
|
| 362 |
label="Model",
|
| 363 |
-
choices=["V5", "V4_5PLUS", "V4_5ALL", "V4_5", "V4"],
|
| 364 |
-
value="
|
| 365 |
interactive=True
|
| 366 |
)
|
| 367 |
|
|
@@ -486,7 +486,7 @@ with gr.Blocks() as app:
|
|
| 486 |
1. **Enter Lyrics** (or leave empty for instrumental)
|
| 487 |
2. **Set Music Style** (e.g., "Pop", "Rock", "Jazz")
|
| 488 |
3. **Enter Song Title**
|
| 489 |
-
4. **Choose Model**
|
| 490 |
5. **Click "Generate Song"**
|
| 491 |
|
| 492 |
### 🔍 Check Any Task via URL
|
|
|
|
| 154 |
if model == "V4" and len(lyrics_text) > 3000:
|
| 155 |
lyrics_text = lyrics_text[:3000]
|
| 156 |
yield f"⚠️ Lyrics truncated to 3000 characters for V4 model\n\n"
|
| 157 |
+
elif model in ["V4_5", "V4_5PLUS", "V4_5ALL", "V5", "V5_5"] and len(lyrics_text) > 5000:
|
| 158 |
lyrics_text = lyrics_text[:5000]
|
| 159 |
yield f"⚠️ Lyrics truncated to 5000 characters for {model} model\n\n"
|
| 160 |
|
|
|
|
| 166 |
if model == "V4" and len(style) > 200:
|
| 167 |
style = style[:200]
|
| 168 |
yield f"⚠️ Style truncated to 200 characters for V4 model\n\n"
|
| 169 |
+
elif model in ["V4_5", "V4_5PLUS", "V4_5ALL", "V5", "V5_5"] and len(style) > 1000:
|
| 170 |
style = style[:1000]
|
| 171 |
yield f"⚠️ Style truncated to 1000 characters for {model} model\n\n"
|
| 172 |
|
|
|
|
| 174 |
if model in ["V4", "V4_5ALL"] and len(title) > 80:
|
| 175 |
title = title[:80]
|
| 176 |
yield f"⚠️ Title truncated to 80 characters for {model} model\n\n"
|
| 177 |
+
elif model in ["V4_5", "V4_5PLUS", "V5", "V5_5"] and len(title) > 100:
|
| 178 |
title = title[:100]
|
| 179 |
yield f"⚠️ Title truncated to 100 characters for {model} model\n\n"
|
| 180 |
|
|
|
|
| 360 |
)
|
| 361 |
model = gr.Dropdown(
|
| 362 |
label="Model",
|
| 363 |
+
choices=["V5_5","V5", "V4_5PLUS", "V4_5ALL", "V4_5", "V4"],
|
| 364 |
+
value="V5_5",
|
| 365 |
interactive=True
|
| 366 |
)
|
| 367 |
|
|
|
|
| 486 |
1. **Enter Lyrics** (or leave empty for instrumental)
|
| 487 |
2. **Set Music Style** (e.g., "Pop", "Rock", "Jazz")
|
| 488 |
3. **Enter Song Title**
|
| 489 |
+
4. **Choose Model**
|
| 490 |
5. **Click "Generate Song"**
|
| 491 |
|
| 492 |
### 🔍 Check Any Task via URL
|