Spaces:
Sleeping
Sleeping
Commit History
6 days ago
-
Price floor: current Claude list prices (Opus 5.5 $4/$20, Fable/Mythos listed so unknown models price at the true highest)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>9f3e49f -
Price floor: transcription, minutes and translation never charged below cost + markup
Each job meters its Claude calls (wrapped client, context carried into pool threads) and GPU time. Charge = max(fixed price, ceil(cost x (1 + markup) / credit_floor_usd())). Minutes and translation hold a generous estimate and settle via complete_minutes_priced; transcription settles at the floor and falls back to the normal price if the balance can't cover the extra. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>a44fe31 -
Nari voice fast path: a dedicated Whisper large-v3 turbo model kept loaded for voice (no engine lock or model swap; preloaded at startup); Yoruba/Igbo/Hausa still use the engine
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 479958e5abd728b04c1e74b1b94526214c64bd97)fa0cec3 -
Nari voice: /voice/transcribe for short spoken questions (shared-secret only, 60 s / 3 MB, waits at most 20 s for the engine, no charge or storage)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit bc2869a97022a9d618ee0ade5a8d7e3d3736f4d5)00998a7
-
Accept resumable Companion uploads with atomic job deduplication
20acaf3
-
Recover missed Paystack payments and retry failed fulfillment
c0770ff
-
Clean up audio before transcription (light level on by default)
New src/audio_processor/enhance.py, numpy/scipy only: - light: DC offset removed, 80 Hz high-pass for rumble, slow speech levelling (quiet speakers lifted up to +12 dB, loud ones lowered up to 6 dB, gain held through pauses so background noise is not pumped up), soft peak limiter. - full: light plus gentle non-stationary spectral gating (floor -12 dB, gains smoothed, noise estimate bias-corrected), only when the recording measures below 25 dB SNR. The engine applies separate levels to the words (AUDIO_ENHANCE_ASR, default light) and to speaker detection (AUDIO_ENHANCE_DIARIZATION, default off). A failed clean-up never fails the job. Evaluation (scripts/enhance_eval_*.py, engine called directly on Modal): AMI ES2004a + IS1009a as headset mix, room mic and headset with hum + chatter, Whisper small and large-v3, plus 11 min of FLEURS Yoruba clean and noisy. Average WER off -> light: large-v3 40.7 -> 39.8, small 46.1 -> 44.8; Yoruba clean 86.4 -> 84.3 (tone-blind 57.4 -> 53.3), n…4f6c67f -
Fix 'NoneType has no attribute tokenizer' and harden job failures
Root cause: _use_model only loaded the dedicated Yoruba/Igbo/Hausa models; Whisper loads on first use, and a model switch drops the loaded pipeline. The mixed-language path read en_pipe.pipeline.tokenizer before the model loaded, so Yoruba/Igbo/Hausa jobs that needed the English check failed outright. _use_model now always hands back a loaded model. Error handling: - The English check only refines a transcript; if it fails the recording is read by the dedicated model instead of failing the job. - One automatic retry for unexpected server errors (not for unreadable audio). Nothing is charged until the job settles. - Failed jobs store a plain reason for the user (unreadable file, server busy, too long, or a general retry message) plus the technical cause for staff; /result returns only the user part. - Failures log the full traceback. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>c98b787
-
Whisper jobs read pause-cut pieces in GPU batches; no stitched 30 s windows
The HF pipeline's 30 s windows (5 s stride) and the 5 min block merge dropped whole sentences and repeated others. On a real 3 min call large-v3 lost the 'within five to ten days...' and 1:53-2:11 passages; on a 24 min file the old path kept 2166 words with one 3 min stretch down to 130, the new one 3021, even across the file, at about the same speed (T4: 179 s processing). - whisper_pieces: speech found from the recording's noise floor, long silences left out, cut at the quietest 0.3 s before 28 s. - ASRPipeline.transcribe_pieces: batched, no silence skip on known speech. - Strip invented all-caps caption names ('BORIS HABIB KOMOKOIKEA- '). - Claude clean-up: never move words between lines; reject corrections that add words (they duplicated the next line). - Speaker alignment: lines with no overlapping turn take the nearest turn. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>f6a9200 -
Accept browser recordings: .webm, plus .opus .mov .mkv .3gp .amr
The engine's format list had no .webm, so every web recording failed with 'Unsupported audio format' after upload. Container formats go straight to pydub/ffmpeg, which reads them and measures their real length. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>a4adcfa
-
Auto-detect probe for Yoruba/Hausa; one-speaker recordings stay one speaker
Auto-detect (the app default) still used Whisper's language guess, which calls Yoruba names English: "1 02 Male Names" came out as 16 English words for 86 s. A sample of pieces is now read by the dedicated model and Whisper; when the dedicated model is surer on half, the recording takes the Yoruba path (English parts still kept). AMI English meeting: 1/8 -> stays English. A Nigerian language plus English also takes that path. Speakers: pyannote was forced to find at least 2, and the voice check only ever added speakers, so one-person lessons showed 2-3 speakers. No minimum now; one speaker when neither pyannote's split nor the voices show distinct people; voice groups must be clearly distinct (silhouette 0.30) to add speakers. 1-02/1-06: 1 speaker; dialogues 3; AMI 4. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>e98e60e -
Yoruba/Igbo/Hausa: decide English by both models' readings; guard tone marks
Tested on all 34 tracks of Beginner's Yoruba (names, vocabulary, greetings, expressions, dialogues). Whisper's language guess can't tell an isolated Yoruba word from English ("Topé", "owó" scored +6..+9 English), so whole vocabulary tracks went to the English model, which spelled words out or invented sentences ("I am a dog"). Now, when a dedicated-model language is chosen, every piece is read by the dedicated model; pieces Whisper thinks may be English are also read by Whisper, and English is kept only when Whisper is clearly surer of a reading made of real English words (or, for a 5+ word sentence, merely ahead), plus pieces next to clear English. Untranscribed speech 2.0% -> 0.3%; English lines are lesson titles, instructions and explanations; names/vocabulary come out as tone-marked Yoruba. Also: short unscored windows default to the chosen language; Claude's tone-mark step is rejected if the letters change (a refusal message was being saved as transcript text). Co-Authored-By: C…c64a5fa -
Cut Yoruba/Igbo/Hausa pieces at speaker turns (speakers detected first)
The dedicated models transcribe piece by piece, and a piece could hold a question and its answer, so it got one speaker and a mixed voice fingerprint. Speaker turns now run before transcription; pieces never span a turn boundary (pyannote finds utterance boundaries reliably even when it can't tell two similar voices apart). Beginner's Yoruba 1-15: every question/answer now its own line, two dialogue voices alternate correctly. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>794177e -
Separate similar voices by sentence; keep short English phrases in English
Speakers: pyannote decides in 10 s windows and merged two similar voices taking short turns (Beginner's Yoruba dialogues: narrator + whole dialogue as "2 speakers"). Each sentence now gets a voice fingerprint (pyannote's own embedding model), sentences are grouped by voice (average linkage, cosine 0.45), and that grouping replaces pyannote's when it separates voices clearly better (silhouette +0.10) and does not reduce the speaker count. Dialogues: 2 -> 3 speakers alternating correctly. AMI IS1009a 94.8% -> 95.9% of speech attributed correctly; ES2004a 98.5% (no regression). Language: English phrases of 1.2 s+ that Whisper scores 6+ nats above the main language are pinned to English even below the 5 s run minimum (measured: English titles +6.4..+8.8, Yoruba windows never above +4.0). "lẹncerin forward in dialogue" -> "Lesson 4-1. Dialogue." Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>a8bd243 -
Google Play Billing for Android credit packs
POST /credits/google checks the purchase token with the Google Play Developer API (product, state, buyer account token, test or real), credits it once as google:<orderId> and consumes it. Refunds and chargebacks are swept every 6 hours from the voided purchases list. Inactive until GOOGLE_PLAY_* credentials are configured. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>a392e63
-
Language switching tuned on real Yoruba/English audio: sequence labelling, evidence filter, sentence pieces for dedicated models, safer clean-up
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>3f29407 -
Meetings that switch language: per-window language ID, smoothed runs, each language on its own model
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>dd0efde
-
Translation priced by length
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>2829006 -
VAPT hardening, translation (Sonnet 5.5), NCAIR native models, language prior, timestamp lead-in fix, sandbox/notetaker/orphan fixes, Azure VM scripts
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>b29f4fa
-
Apple in-app purchase: /credits/apple and /apple/notifications
StoreKit 2 signed transactions are verified against Apple Root CA - G3 (src/apple_iap.py). Each transaction is credited once, only to the account whose appAccountToken it carries. Sandbox purchases are recorded as NGN 0. Refund/revoke notifications take the credits back. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>6c72b72
-
Port long-audio reliability fixes from the HF Space (see Space commit eb4ae44)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>32c229b
-
Fix pyannote import on Modal: upgrade torch to 2.5.1, expose real import error in diarization-status
- Bump modal_app.py torch from 2.1.0 to 2.5.1 — old version caused pyannote.audio import failure due to speechbrain/torch incompatibility on A10G GPU - diarization-status endpoint now runs pyannote import directly to capture the real exception instead of relying on cached module flags - engine.py stores _PYANNOTE_IMPORT_ERROR for future diagnostics Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>ff7b4ba
-
Fix diarization diagnostics, upgrade torch/Dockerfile, add min_speakers hint
- Add startup log + GET /diarization-status endpoint to expose why diarization is available or not (pyannote importable, HF_TOKEN set) - Dockerfile: upgrade base to python:3.11-slim, install CUDA torch wheel before requirements.txt, run as UID 1000 (HF Spaces requirement) - requirements.txt: upgrade torch/transformers/accelerate for torch 2.5+ compatibility, remove gradio/spaces deps (API-only mode) - diarization/engine.py: pass min_speakers=2 when num_speakers not given to prevent pyannote collapsing all speech to a single speaker Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>8280496
-
Add ZeroGPU support for HF Space + fix prompt_ids device mismatch
- Switch HF Space from Docker SDK to Gradio SDK with hardware: zero-gpu - Add hf_app.py: FastAPI REST at / with Gradio demo mounted at /ui - Wrap engine.transcribe_bytes with @spaces.GPU(duration=300) in app.py - Wrap gradio transcribe() with @spaces.GPU via _gpu_decorator in gradio_app.py - Fix prompt_ids tensor created on CPU while model is on MPS (asr_pipeline.py) - Bump gradio 4.7.1 → 4.44.0, add spaces>=0.0.1 to requirements.txt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>a3da822
-
fix: strip Claude explanations from diacritics output; stronger system prompt
fa9ec19 -
fix: smart quotes in yoruba_knowledge.py causing syntax error
c1d6d00 -
fix: persistent job storage, Yoruba diacritics, diarization alignment, multi-language support
- Add Supabase-backed persistent job storage (fixes lost results on container restart) - Add Yoruba knowledge base with 100+ names/vocabulary and tone rules - Integrate Yoruba knowledge into Claude diacritics post-processing - Fix diarization alignment for chunked audio (accumulate overlap per speaker) - Remove hallucination-causing stock-sentence initial_prompts - Pass language code explicitly to Whisper for Nigerian languages - Support comma-separated multi-language hints (yo,en / ig,en / ha,en) - Fix invalid segment timestamps (end < start) from Whisper - Improve repetition loop detection (sentence-level, char-dominance) - Update Claude model to claude-haiku-4-5-202510013dcdf79
-
fix: isolate chunk and upload temp files per job to prevent concurrent collision
chunk_{index}.wav naming caused two simultaneous jobs to overwrite each other's temp files — Council Meeting (58 chunks) and Male Names (3 chunks) ran concurrently and Male Names wrote chunk_0.wav before Council Meeting finished reading it, producing the wrong transcript for each job. Fix: prefix chunk files with a per-call uuid token (chunk_{token}_{i}.wav) and give each transcribe_bytes call a unique upload path so concurrent uploads of the same filename no longer conflict. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>7ed7cfd -
fix: pass prompt_ids as numpy array, not Python list
tokenizer.encode() returns a plain list; Whisper's generation mixin calls .tolist() on prompt_ids expecting a tensor/ndarray, raising 'list object has no attribute tolist' and crashing every chunked job. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1f48cf3 -
fix: VBR MP3 chunking, beam search, spanning segments, diarization threshold
- engine.py: use len(audio)/sr as actual duration so VBR MP3s (where sf.info() silently returns wrong duration) correctly trigger chunking; pass last 200 chars of each chunk as initial_prompt for cross-chunk context - validator.py: route MP3/M4A/AAC/WMA directly to pydub (skip soundfile which misreports VBR container durations without raising an exception) - chunker.py: keep segments that straddle the overlap cutoff (seg_end > cutoff) instead of dropping them entirely, preventing silent content loss at boundaries - asr_pipeline.py: forward beam_size from config to generate_kwargs so settings.yaml beam_size: 5 actually runs beam search instead of greedy - diarization/engine.py: lower speaker assignment threshold 30% -> 20% to handle fast turn-taking where short segments span two speakers Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>6ad496b
-
feat: Modal deployment, Paystack webhooks, usage tracking, Nigerian language fixes
- Add modal_app.py: A10G GPU deployment with persistent model volume, 60s scaledown window (down from 300s, saves ~$100/mo idle GPU cost) - Add Paystack /init and /webhook endpoints with HMAC-SHA512 verification; updates Supabase user_profiles on subscription lifecycle events - Track audio_minutes_used per user in Supabase after each transcription - Fix Yoruba/Igbo/Hausa transcription: auto-upgrade to whisper-large-v3, add code-switching prompts for Nigerian language audio - Fix audio chunker: deduplication, proper overlap handling - Fix audio converter: pydub duration, sample rate normalisation - Add requests to requirements.txt - Update .gitignore to exclude .env and .venv Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>cbdcf47
-
Switch to async FastAPI REST API; fix chunker dedup, GPU diarization, torch dtypes, pydub duration
- Dockerfile: serve app.py via uvicorn (FastAPI REST) instead of Gradio UI - app.py: /transcribe returns 202 immediately, background task runs pipeline, /result/{job_id} for polling - chunker.py: fix merge dedup (>= last_end_time), monotonic segment IDs - diarization/engine.py: explicitly move pyannote pipeline to cuda:0 - registry.py: torch_dtype=float16 on CUDA, chunk_length_s/stride_length_s - asr_pipeline.py: strip unsupported generate_kwargs - validator.py: use pydub for full-duration extraction (not librosa truncated) - requirements.txt: add torchaudio==2.1.0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1deeec7
-
fix: catch OSError during pyannote import on CPU-only containers
4ef007b -
feat: speaker diarization, CSV export, translation, Nigerian languages, video support
- Add pyannote.audio-based speaker diarization engine (src/diarization/) - Add Meeting Mode to Gradio UI with expected speaker count hint - Add CSV export format for spreadsheet-friendly meeting minutes - Update /transcribe API to accept diarization, num_speakers params - Include segment IDs in ASR pipeline for frontend compatibility - Add video file support via existing MP4 handling - Promote Hausa, Yoruba, Igbo in language lists - Update README with new API docs and HF_TOKEN setup instructions305b729
-
initial: modular ASR system v2
e2ef3c4