Spaces:
Runtime error
Runtime error
Peter Michael Gits Claude commited on
Commit ·
ac6f784
1
Parent(s): 9201e6d
Fix NumPy array writable warning in audio processing
Browse filesv1.4.2 - Minor fix: PyTorch non-writable tensor warning
- Added .copy() to audio_data before torch.from_numpy()
- Prevents: 'PyTorch does not support non-writable tensors' warning
- Improves memory safety during audio tensor conversion
- CPU transcription working well with client connections
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
20 unmodified lines21222324252627109 unmodified lines13713813914014114214320 unmodified linesimport uvicorn# Version trackingVERSION = "1.4.1"COMMIT_SHA = "TBD"# Configure logging109 unmodified lineslogger.info(f"Using device for transcription: {model_device}")# Convert to torch tensor and put on same device as modelswav = torch.from_numpy(audio_data).unsqueeze(0).unsqueeze(0).to(model_device)# Process with Mimi codec in streaming modewith torch.no_grad(), mimi.streaming(batch_size=1):20 unmodified lines21222324252627109 unmodified lines13713813914014114214314420 unmodified linesimport uvicorn# Version trackingVERSION = "1.4.2"COMMIT_SHA = "TBD"# Configure logging109 unmodified lineslogger.info(f"Using device for transcription: {model_device}")# Convert to torch tensor and put on same device as models# Copy array to avoid PyTorch writable tensor warningwav = torch.from_numpy(audio_data.copy()).unsqueeze(0).unsqueeze(0).to(model_device)# Process with Mimi codec in streaming modewith torch.no_grad(), mimi.streaming(batch_size=1):
app.py+3-2