Spaces:
Runtime error
Runtime error
Peter Michael Gits Claude commited on
Commit Β·
1a1d398
1
Parent(s): 17f8efe
Add detailed debugging for lm_gen.step() returning None
Browse filesv1.4.8 - Debug text generation failure:
- Added detailed logging for lm_gen.step() calls
- Check if step() returns None vs actual tensor data
- Log tensor shapes and types at each step
- Will reveal why 'NoneType' object is not subscriptable
- Progress: Audio encoding β
, C++ compiler β
, debugging step API
π€ Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
app.py
CHANGED
|
@@ -21,7 +21,7 @@ from fastapi.responses import JSONResponse, HTMLResponse
|
|
| 21 |
import uvicorn
|
| 22 |
|
| 23 |
# Version tracking
|
| 24 |
-
VERSION = "1.4.
|
| 25 |
COMMIT_SHA = "TBD"
|
| 26 |
|
| 27 |
# Configure logging
|
|
@@ -182,11 +182,21 @@ def transcribe_audio_moshi(audio_data: np.ndarray, sample_rate: int = 24000) ->
|
|
| 182 |
for i in range(audio_tokens.shape[-1]):
|
| 183 |
# Extract single timestep tokens
|
| 184 |
code_step = audio_tokens[:, :, i:i+1] # [B, 8, 1]
|
|
|
|
|
|
|
| 185 |
# Generate tokens using step method
|
| 186 |
tokens_out = lm_gen.step(code_step) # [B, 1 + 8, 1]
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
|
| 191 |
# Concatenate all text tokens
|
| 192 |
if text_tokens:
|
|
|
|
| 21 |
import uvicorn
|
| 22 |
|
| 23 |
# Version tracking
|
| 24 |
+
VERSION = "1.4.8"
|
| 25 |
COMMIT_SHA = "TBD"
|
| 26 |
|
| 27 |
# Configure logging
|
|
|
|
| 182 |
for i in range(audio_tokens.shape[-1]):
|
| 183 |
# Extract single timestep tokens
|
| 184 |
code_step = audio_tokens[:, :, i:i+1] # [B, 8, 1]
|
| 185 |
+
logger.info(f"π Step {i}: code_step shape: {code_step.shape}")
|
| 186 |
+
|
| 187 |
# Generate tokens using step method
|
| 188 |
tokens_out = lm_gen.step(code_step) # [B, 1 + 8, 1]
|
| 189 |
+
logger.info(f"π Step {i}: tokens_out type: {type(tokens_out)}, value: {tokens_out}")
|
| 190 |
+
|
| 191 |
+
if tokens_out is not None:
|
| 192 |
+
logger.info(f"π Step {i}: tokens_out shape: {tokens_out.shape}")
|
| 193 |
+
# Extract text token (index 1)
|
| 194 |
+
text_token = tokens_out[:, 1:2, :] # [B, 1, 1]
|
| 195 |
+
text_tokens.append(text_token)
|
| 196 |
+
logger.info(f"β
Step {i}: Added text token shape: {text_token.shape}")
|
| 197 |
+
else:
|
| 198 |
+
logger.error(f"β Step {i}: lm_gen.step() returned None!")
|
| 199 |
+
break
|
| 200 |
|
| 201 |
# Concatenate all text tokens
|
| 202 |
if text_tokens:
|