Spaces:
Sleeping
Sleeping
jefffffff9 Claude Sonnet 4.6 commited on
Commit ·
f1012fa
1
Parent(s): 842ded5
Fix Cell 8: remove FLEURS fallback + strip emoji (charmap safe)
Browse filesNotebook was still falling back to google/fleurs on Kaggle because
the previous NotebookEdit did not land in the pushed version.
This commit forces the correct state:
- bam -> None (no WaxalNLP subset, skip cleanly)
- ful -> 'ful_asr' (confirmed config name)
- FLEURS removed entirely (datasets>=3.0 blocks its script loader)
- All emoji replaced with ASCII so Windows charmap never triggers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
80 unmodified lines8182838485868780 unmodified lines"id": "cell-waxal","metadata": {},"outputs": [],"source": "# ── Cell 8: Load WaxalNLP ─────────────────────────────────────────────────────\n# WaxalNLP (google/WaxalNLP) available ASR subsets:\n# Fula → 'ful_asr' ✅ (confirmed in dataset card)\n# Bambara → NOT present ❌ (bam is not a WaxalNLP config)\n#\n# For Bambara, user corrections + Common Voice (Cell 4) are the data sources.\n# google/fleurs is NOT used — datasets>=3.0 refuses to run its script loader.\n#\n# Reference: WaxalNLP configs include ful_asr, ful_tts, ewe_asr, hau_tts, etc.\n# Full list: https://huggingface.co/datasets/google/WaxalNLP\n\nfrom datasets import load_dataset, Audio as HFAudio\n\nWAXAL_SUBSET_MAP = {\n 'bam': None, # no Bambara subset in WaxalNLP\n 'ful': 'ful_asr', # confirmed available config\n}\n\nwaxal_ds = None\nWAXAL_TEXT_COL = 'transcription'\n\nsubset = WAXAL_SUBSET_MAP.get(TRAIN_LANG)\n\nif subset is None:\n print(f'WaxalNLP: no subset available for lang={TRAIN_LANG}.')\n print(' Bambara training will rely on user corrections + any enabled external datasets (Cell 4).')\nelse:\n try:\n print(f'Loading google/WaxalNLP subset={subset} (streaming) ...')\n waxal_ds = load_dataset(\n 'google/WaxalNLP', subset,\n split='train',\n streaming=True,\n token=HF_TOKEN,\n )\n\n # Verify schema by probing the first item\n probe = next(iter(waxal_ds))\n if 'audio' not in probe:\n raise ValueError(f'No audio column. Available: {list(probe.keys())}')\n\n WAXAL_TEXT_COL = next(\n (k for k in ['transcription', 'text', 'sentence', 'normalized_text']\n if k in probe),\n None,\n )\n if WAXAL_TEXT_COL is None:\n raise ValueError(f'No text column found. Keys: {list(probe.keys())}')\n\n print(f'✅ WaxalNLP/{subset} ready — text column: \"{WAXAL_TEXT_COL}\"')\n\n except Exception as e:\n print(f'⚠️ WaxalNLP/{subset} failed: {e}')\n print(' Continuing without WaxalNLP — enable Common Voice in Cell 4 for coverage.')\n waxal_ds = None\n\nprint()\nstatus = f'WaxalNLP/{subset}' if waxal_ds is not None else 'not available'\nprint(f'Waxal source for {TRAIN_LANG}: {status}')"},{"cell_type": "code",80 unmodified lines8182838485868780 unmodified lines"id": "cell-waxal","metadata": {},"outputs": [],"source": "# -- Cell 8: Load WaxalNLP ----------------------------------------------------\n# WaxalNLP confirmed subsets (google/WaxalNLP dataset card):\n# Fula -> 'ful_asr' (available)\n# Bambara -> NOT present (no 'bam' config exists)\n#\n# google/fleurs is NOT used as a fallback -- datasets >= 3.0 refuses\n# to execute its legacy script loader (fleurs.py).\n#\n# Bambara training uses: user corrections (Cell 7) + Common Voice bm (Cell 4).\n# Fula training uses: user corrections + WaxalNLP ful_asr + Common Voice ff.\n\nfrom datasets import load_dataset, Audio as HFAudio\n\nWAXAL_SUBSET_MAP = {\n 'bam': None, # no Bambara subset in WaxalNLP -- skip silently\n 'ful': 'ful_asr', # confirmed available config\n}\n\nwaxal_ds = None\nWAXAL_TEXT_COL = 'transcription'\n\nsubset = WAXAL_SUBSET_MAP.get(TRAIN_LANG)\n\nif subset is None:\n print(f'WaxalNLP has no subset for lang={TRAIN_LANG} -- skipping.')\n print('Bambara will train on user corrections + Common Voice (Cell 4).')\nelse:\n try:\n print(f'Loading google/WaxalNLP subset={subset} (streaming) ...')\n waxal_ds = load_dataset(\n 'google/WaxalNLP', subset,\n split='train',\n streaming=True,\n token=HF_TOKEN,\n )\n\n # Probe first item to confirm schema\n probe = next(iter(waxal_ds))\n if 'audio' not in probe:\n raise ValueError(f'No audio column. Keys: {list(probe.keys())}')\n\n WAXAL_TEXT_COL = next(\n (k for k in ['transcription', 'text', 'sentence', 'normalized_text']\n if k in probe),\n None,\n )\n if WAXAL_TEXT_COL is None:\n raise ValueError(f'No text column. Keys: {list(probe.keys())}')\n\n print(f'WaxalNLP/{subset} ready -- text column: \"{WAXAL_TEXT_COL}\"')\n\n except Exception as e:\n print(f'WaxalNLP/{subset} failed: {e}')\n print('Continuing without WaxalNLP -- enable Common Voice in Cell 4.')\n waxal_ds = None\n\nstatus = f'WaxalNLP/{subset}' if waxal_ds is not None else 'not available'\nprint(f'\\nWaxal source for {TRAIN_LANG}: {status}')"},{"cell_type": "code",
notebooks/kaggle_master_trainer.ipynb+1-1