Spaces:
Running
Running
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
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 |
|