Skip to content

pocket_tts: give the built-in defaults the upstream text options - #1352

Merged
0xShug0 merged 1 commit into
0xShug0:mainfrom
unaltolga:fix/pocket-tts-builtin-text-defaults
Nov 20, 2026
Merged

0xShug0 merged 1 commit into
0xShug0:mainfrom
unaltolga:fix/pocket-tts-builtin-text-defaults

Conversation

@unaltolga

Copy link
Copy Markdown
Contributor

What

Follow-up to #1339. The published English, German, Italian, Portuguese and Spanish packages (PocketTTS-GGUF/<language>) embed only tokenizer.model, so their text options come from descriptor_from_builtin_defaults. Those defaults had no replace_characters table and set remove_semicolons for french_24l only. Upstream ships a table for every language, the same at 6 and 24 layers, and maps ; to , for French and German at both sizes.

Package Input main this PR (and the Python reference)
german „Guten Tag“, sagte er – und ging dann nach Hause. unchanged Guten Tag, sagte er , und ging dann nach Hause.
german Das Treffen (am Montag) ist wichtig; bitte komm pünktlich. unchanged Das Treffen am Montag ist wichtig, bitte komm pünktlich.
spanish ¿Cómo estás? «Bien», dijo ella en voz baja. unchanged Cómo estás? Bien, dijo ella en voz baja.
italian «Ciao» disse (piano) – poi andò via. unchanged Ciao disse piano , poi andò via.
english It’s fine, he said (quietly) – then left. unchanged It's fine, he said (quietly) – then left.

Changes

  • descriptor_from_builtin_defaults takes upstream's table for english*, french*, german*, italian*, portuguese*, spanish* and dutch*: ’ and ‘ become '. In every language but English, quotes, guillemets and brackets are deleted and – becomes ,. French also maps : to ,, German maps U+2014 (em dash) to ,, and Spanish deletes ¡ and ¿. Any other language name keeps no table.
  • remove_semicolons is on for french* and german*. Before, it was on for french_24l only.
  • A config the package embeds still wins, so the French package is unchanged.

Validation

macOS 27.2 on an Apple M2, CPU backend (the Mac CI configuration), with the q8_0 packages. The text and WER runs below were on df60b9d. I then rebased onto a282e4e, where nothing under src/models/pocket_tts has changed, and ran ctest again there.

  • Same text and token ids as the Python reference. I ran the probe from pocket_tts: apply the config's replace_characters like the reference #1339 (load_pocket_tts_assets and TextConditioner::prepare) on 18 lines with quotes, guillemets, brackets, dashes and semicolons, across German, Spanish, Italian, Portuguese and English. I compared it with pocket-tts prepare_text_prompt, called with that language's upstream config and the package's own tokenizer.model. The prepared text and the token ids match on every line. The tables have 14, 15, 13, 13 and 2 entries, as upstream's do.

  • Runtime, before and after. I synthesized 8 German and 8 Spanish sentences with audiocpp_cli (--load-option pocket_tts.language=<language>, voice alba, seeds 1 to 4), built from main and from this branch. I transcribed them with Whisper small (language=de / es) and scored WER against the words to be spoken:

    Language main this PR sentences better / worse / same
    German (256 words) 36.3% 19.1% 6 / 1 / 1
    Spanish (248 words) 44.8% 26.6% 5 / 2 / 1
  • ctest on a282e4e: 114 of 118 pass from the build directory, and the other 4 pass when run from the repository root, as in pocket_tts: apply the config's replace_characters like the reference #1339 (parakeet_variant_config_test, lfm2_audio_assets_test, lfm3_audio_assets_test and model_spec_system_test look for model_specs/ relative to the working directory).

AI disclosure: written with Claude Code (Claude Opus 5.5). I reviewed the change, and the results above are from real runs on my Mac.

The language packages other than French embed no config, so their text
options come from descriptor_from_builtin_defaults, which had no
replace_characters table and turned remove_semicolons on for french_24l only.
Upstream ships the same table at 6 and 24 layers for each language and maps
";" to "," for French and German at both sizes. The built-in defaults now
carry those tables for the languages upstream ships; any other language name
keeps no table.
@0xShug0
0xShug0 merged commit fe6d153 into 0xShug0:main Nov 20, 2026
7 checks passed
@0xShug0

0xShug0 commented Nov 20, 2026

Copy link
Copy Markdown
Owner

@unaltolga Thanks! PR merged 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants