Spaces:
Running
Running
futurespyhi
commited on
Commit
Β·
2ab39a8
1
Parent(s):
e3adaee
Fix undefined variables by extracting parameters from cmd
Browse files- Extract run_n_segments and max_new_tokens from cmd list for logging
- Add safe fallback values if parameters not found in cmd
- Resolve variable not defined warnings while maintaining functionality
app.py
CHANGED
|
@@ -378,6 +378,10 @@ def generate_music_spaces(lyrics: str, genre: str, mood: str, progress=gr.Progre
|
|
| 378 |
progress(0.15, desc="π Processing lyrics...")
|
| 379 |
progress(0.2, desc="π΅ Starting Stage 1 (7B model generation)...")
|
| 380 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 381 |
print("π΅ Starting high-quality music generation...")
|
| 382 |
print(f"π Generation settings: {run_n_segments} segments, {max_new_tokens} tokens, 30s audio")
|
| 383 |
print(f"β±οΈ Estimated time: 2-4 minutes for high-quality generation")
|
|
|
|
| 378 |
progress(0.15, desc="π Processing lyrics...")
|
| 379 |
progress(0.2, desc="π΅ Starting Stage 1 (7B model generation)...")
|
| 380 |
|
| 381 |
+
# Extract parameters from cmd for logging
|
| 382 |
+
run_n_segments = cmd[cmd.index("--run_n_segments") + 1] if "--run_n_segments" in cmd else "2"
|
| 383 |
+
max_new_tokens = cmd[cmd.index("--max_new_tokens") + 1] if "--max_new_tokens" in cmd else "3000"
|
| 384 |
+
|
| 385 |
print("π΅ Starting high-quality music generation...")
|
| 386 |
print(f"π Generation settings: {run_n_segments} segments, {max_new_tokens} tokens, 30s audio")
|
| 387 |
print(f"β±οΈ Estimated time: 2-4 minutes for high-quality generation")
|