Spaces:
Sleeping
Sleeping
Commit History
-
Phrasebook eval harness + accent/filler-tolerant matching
ous-sow +1: Claude Opus 5.5- configs/eval/phrasebook_eval.json: 85 held-out inputs (typos, code-switching, filler words, open-ended questions that must reach the LLM), written to differ from the curated aliases. - scripts/eval_phrasebook.py: scores correct / wrong / false_hit / miss per language. - _normalize now folds Latin accents (ça -> ca), drops politeness filler (please, svp, s'il vous plaît) and leading articles (du, une, some). Applied to both sides; Bambara/Pular letters (ɛ ɔ ɓ ŋ) are untouched. Hit rate on the eval set: before aliases bam 43% ful 46% + aliases bam 80% ful 77% + normaliser bam 88% ful 86% wrong=0 and false_hit=0 at every step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>ea5dc26
-
Phrasebook: multi-alias + French source keys, plus misses-script stub
jefffffff9 +1: Claude Opus 4.7Two-track vocabulary enrichment that keeps the matcher and UI unchanged: 1. Multi-alias entries. Each curated row may now carry any combination of `source`, `sources` (list), `source_fr`, `sources_fr` (list). The loader flattens them into one match-candidate per alias, all pointing at the same target translation. A typed paraphrase ("morning, sir") or French equivalent ("bonjour") hits the same Bambara/Pular target as the canonical English source. Existing single-`source` rows keep working unchanged (verified: 110 rows → 110 candidates, exact match preserved). 2. top_k now dedupes by canonical target so multi-alias rows can't crowd out the RAG few-shot slots. 3. scripts/phrasebook_misses.py — stub for the data-driven curation loop. Reads data/field_turns.jsonl, groups translate-phase rows where phrasebook=null, prints the most frequent unmet inputs. Filters by --lang and --since. --draft (LLM-proposed target per miss) is a marked TODO — wire it when …5815492
-
Forbid parenthetical glosses in LLM replies
jefffffff9 +1: Claude Opus 4.7The model was appending English literal-translation annotations (e.g. "On walli e jam? (Lit: Did you sleep in peace?)") which then got read aloud by TTS as gibberish. Two-layer fix: 1. System prompt now explicitly bans "(Lit: ...)", "(meaning ...)", and any English/French parenthetical aside, and demands 100% target-language output. 2. Defensive client-side regex strips any "(Lit/Literal/Meaning/ Translation/English/French ...)" parenthetical the model emits anyway before returning the string to TTS. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>757e833
-
Stage 4: split translate/reply UI + CPU-safe TTS + reply-not-translate prompt
jefffffff9 +1: Claude Opus 4.7- 4-box layout on both Voice and Text tabs: phrasebook translation (text + audio) is automatic on submit; "Generate reply" runs the dialect-anchored LLM only when clicked. - Shared gr.State carries the canonical input (typed text or Whisper transcript) into the reply button so we never re-transcribe. - Robust device resolution: probe cuda.device_count(), and have _synthesize retry on CPU when CUDA path raises (fixes "Torch not compiled with CUDA" on CPU-only laptops). - System prompt now explicitly tells the LLM to REPLY conversationally and reframes the curated few-shot pairs as style/orthography references only, fixing the regression where the model would echo the phrasebook target verbatim instead of replying. - README: add Stage 4 entry + update entry-points table. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>9e99c2c -
Per-turn telemetry + RAG few-shot on phrasebook miss
jefffffff9Telemetry (src/engine/turn_logger.py) Thread-safe JSONL append logger writing one self-contained row per turn to data/field_turns.jsonl (overridable via FIELD_TURNS_PATH). Captures ts, tab, langs, transcript/user_text, phrasebook hit details, llm model + ms, reply, tts ms, total ms, error. Foundation for field-test review, phrasebook hit-rate measurement, and Stage-4 training-data curation. Never raises — telemetry must not break the user-facing pipeline. RAG few-shot (src/llm/phrasebook.py + src/llm/minimal_client.py) - phrasebook.top_k(text, lang, k=3): nearest-K phrasebook entries regardless of threshold, sorted by descending fuzzy score. - MinimalClient.chat() now accepts extra_examples; _build_system_prompt appends them as a second 'Additional reference phrases relevant to the current user input' section after the 30-pair anchor list. app_minimal.py - Both run_pipeline (voice) and run_text_pipeline (text) now share a single _resolve_reply() help…064d08b -
Remove stale Qwen references from minimal-baseline docstrings
jefffffff9Runtime defaults already point to CohereLabs/aya-expanse-32b; only docstrings / usage examples still named Qwen. Cosmetic cleanup only.cc82bd8
-
Ground-zero Stages 1–3: dialect anchors + phrasebook short-circuit + Aya-Expanse
jefffffff9Stage 1 — dialect-pinned LLM client (src/llm/minimal_client.py) Plain-text replacement for GemmaClient's JSON/teacher flow. System prompt pins Bambara-Mali and Pular-Fuuta-Jallon explicitly, names forbidden neighbouring languages (Wolof, Hausa, Pulaar-Senegal, Fulfulde-Nigeria, Jula-CI), and injects a 30-pair bilingual gold list as few-shot anchoring from configs/dialect_anchors/{bambara_mali,pular_guinea}.json. Stage 2 — curated phrasebook short-circuit (src/llm/phrasebook.py) 100 Bambara + 110 Pular English-keyed pairs across greetings, family, food, farming, health, shopping, travel, clarity, time, parting. Fuzzy matched (threshold 0.88) before every LLM call; on hit returns the gold translation directly — zero drift risk, zero latency. Stage 3 — default LLM swapped to CohereLabs/aya-expanse-32b 23-language multilingual base with stronger West African coverage than Qwen 2.5-7B. Overridable via LLM_MODEL_ID. Space wiring - README frontmatter app_file: app.p…d0e28fa
-
Fix: switch LLM to Qwen2.5-72B-Instruct (Gemma not on HF free tier)
jefffffff9 +1: Claude Sonnet 4.6google/gemma-3-4b-it requires a paid provider on HF Serverless Inference. Qwen/Qwen2.5-72B-Instruct is available on the free tier and has better multilingual coverage for Bambara/Fula context. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>61e52d7 -
Phase 1: Sahel-Voice-Lab — The Memory Loop
jefffffff9 +1: Claude Sonnet 4.6New project pivot: self-learning voice assistant for Bambara/Fula using 100% non-Meta tech stack. New files: - app_lab.py — Gradio UI: push-to-talk + last 5 words panel - src/memory/memory_manager.py — persists vocabulary.jsonl to HF Hub - src/llm/gemma_client.py — Gemma via HF Serverless Inference API - data/vocabulary.jsonl — empty initial vocabulary store Flow: audio → Whisper STT → Gemma (with vocabulary context) → teaching intent → MemoryManager.add_word_pair() → Hub push question intent → answer from vocabulary conversation → natural reply README.md updated: app_file changed to app_lab.py, stack documented. Stack: openai/whisper-large-v3-turbo (STT), google/gemma-3-4b-it (LLM), Waxal TTS (Phase 2), HF Dataset for memory. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>096b19d