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

Files changed (1) hide show
  1. app.py +4 -0
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")