futurespyhi commited on
Commit
9853042
Β·
1 Parent(s): b81feb7

Add debugging output for lyrics processing

Browse files

- Print raw lyrics input from UI
- Print formatted lyrics content and length
- Print lyrics file path and written content
- Help identify where lyrics are being lost in the pipeline

Files changed (1) hide show
  1. app.py +13 -0
app.py CHANGED
@@ -304,9 +304,22 @@ def generate_music_spaces(lyrics: str, genre: str, mood: str, progress=gr.Progre
304
  genre_file.write(f"instrumental,{genre},{mood},male vocals")
305
  genre_file_path = genre_file.name
306
 
 
 
 
 
 
307
  with tempfile.NamedTemporaryFile(mode='w', suffix='.txt', delete=False) as lyrics_file:
308
  lyrics_file.write(formatted_lyrics)
309
  lyrics_file_path = lyrics_file.name
 
 
 
 
 
 
 
 
310
 
311
  progress(0.2, desc="Setting up generation...")
312
 
 
304
  genre_file.write(f"instrumental,{genre},{mood},male vocals")
305
  genre_file_path = genre_file.name
306
 
307
+ # Debug: Print lyrics content for debugging
308
+ print(f"πŸ› DEBUG - Raw lyrics input: '{lyrics}'")
309
+ print(f"πŸ› DEBUG - Formatted lyrics: '{formatted_lyrics}'")
310
+ print(f"πŸ› DEBUG - Formatted lyrics length: {len(formatted_lyrics)}")
311
+
312
  with tempfile.NamedTemporaryFile(mode='w', suffix='.txt', delete=False) as lyrics_file:
313
  lyrics_file.write(formatted_lyrics)
314
  lyrics_file_path = lyrics_file.name
315
+
316
+ print(f"πŸ› DEBUG - Lyrics file path: {lyrics_file_path}")
317
+
318
+ # Debug: Read back the file to verify what was written
319
+ with open(lyrics_file_path, 'r') as verify_file:
320
+ written_content = verify_file.read()
321
+ print(f"πŸ› DEBUG - Content written to file: '{written_content}'")
322
+ print(f"πŸ› DEBUG - Written content length: {len(written_content)}")
323
 
324
  progress(0.2, desc="Setting up generation...")
325