apptor commited on
Commit
9cfaac3
·
verified ·
1 Parent(s): 645650a

v0.2: model trained further on the most clearly Austrian speakers, Kaffee with a long ee, new samples

Browse files
README.md CHANGED
@@ -17,7 +17,7 @@ tags:
17
  - vocos
18
  ---
19
 
20
- # apptor-tiny-tts-at (Austrian German, v0.1)
21
 
22
  A tiny German text-to-speech model with an **Austrian accent you can turn up or down**: from Hochdeutsch (0) to
23
  Austrian (1.0) and a bit beyond (up to 1.6). 4.5M parameters, one 21 MB ONNX file, two synthetic voices (`M2`
@@ -25,7 +25,7 @@ male, `F2` female), 24 kHz. Runs on the CPU and **directly in the browser**, wit
25
 
26
  **Try it:** [tiny-tts.apptor.at](https://tiny-tts.apptor.at) (everything runs on your device).
27
 
28
- This is **version 0.1, an early preview**. The accent is still mild and does not sit in every word: better than
29
  nothing, but not fully Austrian yet. It was trained on a single GPU. Feedback is welcome on
30
  [X @apptor_at](https://x.com/apptor_at).
31
 
@@ -104,7 +104,9 @@ split long text into sentences. When the accent is on (>= 0.5), a short list of
104
  - **Accent:** fine-tuned for 24k steps on one RTX 5060 Ti with 8,208 Austrian recordings from
105
  [Mozilla Common Voice](https://commonvoice.mozilla.org) German (CC0), next to the two synthetic voices. The
106
  Austrian speakers share one *style* (pronunciation and melody); the *voice* (timbre) stays F2 or M2. The accent
107
- slider moves between the voice's own style and the Austrian style. All real speakers were removed from the
 
 
108
  exported model: it can only speak with the two synthetic voices.
109
  - **Voices:** synthetic, made with Qwen3-TTS (Apache-2.0) built-in voices; not clones of real people.
110
  - **Front end without eSpeak:** the G2P model learned the eSpeak NG readings of ~480,000 words from the Common
@@ -113,7 +115,7 @@ split long text into sentences. When the accent is on (>= 0.5), a short list of
113
 
114
  ## Limitations
115
 
116
- - v0.1: the accent is mild, not dialect. Some words and names are still pronounced oddly.
117
  - German only. English words are read with German pronunciation.
118
  - Not studio quality; without the sound filter the voice is buzzy.
119
 
@@ -121,7 +123,7 @@ split long text into sentences. When the accent is on (>= 0.5), a short list of
121
 
122
  Eine kleine deutsche Stimme, die auch (etwas) österreichisch kann: Akzent stufenlos von Hochdeutsch (0) bis
123
  österreichisch (1,0, maximal 1,6). 4,5 Mio. Parameter, läuft auf der CPU und direkt im Browser, ohne eSpeak und
124
- ohne Server. Version 0.1, eine frühe Vorschau, trainiert auf einer einzigen Grafikkarte. Der Akzent ist noch
125
  dezent: besser als nichts, aber noch nicht ganz österreichisch. Ausprobieren: [tiny-tts.apptor.at](https://tiny-tts.apptor.at).
126
  Rückmeldungen gern auf [X @apptor_at](https://x.com/apptor_at). Apache 2.0, also auch kommerziell nutzbar.
127
 
 
17
  - vocos
18
  ---
19
 
20
+ # apptor-tiny-tts-at (Austrian German, v0.2)
21
 
22
  A tiny German text-to-speech model with an **Austrian accent you can turn up or down**: from Hochdeutsch (0) to
23
  Austrian (1.0) and a bit beyond (up to 1.6). 4.5M parameters, one 21 MB ONNX file, two synthetic voices (`M2`
 
25
 
26
  **Try it:** [tiny-tts.apptor.at](https://tiny-tts.apptor.at) (everything runs on your device).
27
 
28
+ This is **version 0.2, an early preview**. The accent is still mild and does not sit in every word: better than
29
  nothing, but not fully Austrian yet. It was trained on a single GPU. Feedback is welcome on
30
  [X @apptor_at](https://x.com/apptor_at).
31
 
 
104
  - **Accent:** fine-tuned for 24k steps on one RTX 5060 Ti with 8,208 Austrian recordings from
105
  [Mozilla Common Voice](https://commonvoice.mozilla.org) German (CC0), next to the two synthetic voices. The
106
  Austrian speakers share one *style* (pronunciation and melody); the *voice* (timbre) stays F2 or M2. The accent
107
+ slider moves between the voice's own style and the Austrian style.
108
+ v0.2: 10k more steps (on an RTX 3090) in which only the 26 speakers rated most clearly Austrian form the style,
109
+ so the accent is stronger at the same setting. All real speakers were removed from the
110
  exported model: it can only speak with the two synthetic voices.
111
  - **Voices:** synthetic, made with Qwen3-TTS (Apache-2.0) built-in voices; not clones of real people.
112
  - **Front end without eSpeak:** the G2P model learned the eSpeak NG readings of ~480,000 words from the Common
 
115
 
116
  ## Limitations
117
 
118
+ - v0.2: the accent is mild, not dialect; the strongest settings (around 1.6) still sound a little distorted. Some words and names are still pronounced oddly.
119
  - German only. English words are read with German pronunciation.
120
  - Not studio quality; without the sound filter the voice is buzzy.
121
 
 
123
 
124
  Eine kleine deutsche Stimme, die auch (etwas) österreichisch kann: Akzent stufenlos von Hochdeutsch (0) bis
125
  österreichisch (1,0, maximal 1,6). 4,5 Mio. Parameter, läuft auf der CPU und direkt im Browser, ohne eSpeak und
126
+ ohne Server. Version 0.2, eine frühe Vorschau, trainiert auf einer einzigen Grafikkarte. Der Akzent ist noch
127
  dezent: besser als nichts, aber noch nicht ganz österreichisch. Ausprobieren: [tiny-tts.apptor.at](https://tiny-tts.apptor.at).
128
  Rückmeldungen gern auf [X @apptor_at](https://x.com/apptor_at). Apache 2.0, also auch kommerziell nutzbar.
129
 
apptor-tiny-tts-at.json CHANGED
@@ -77,7 +77,7 @@
77
  ],
78
  "max_tokens": 512,
79
  "max_frames": 3000,
80
- "step": 126000,
81
  "frontend": "espeak",
82
  "frontend_fingerprint": "ddefc3ebfe4beeca2af195dc920c207110b07bd5067f225c575a3cdeef02d73f",
83
  "inputs": [
 
77
  ],
78
  "max_tokens": 512,
79
  "max_frames": 3000,
80
+ "step": 136000,
81
  "frontend": "espeak",
82
  "frontend_fingerprint": "ddefc3ebfe4beeca2af195dc920c207110b07bd5067f225c575a3cdeef02d73f",
83
  "inputs": [
apptor-tiny-tts-at.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:1db856e5aac4f6b21f6b7f6e026a63fa8fb29469fa2301b8b166ffc5ebaae05d
3
  size 21382102
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a478c9827965aceadd03d812a74ecdaed856296fc2a577e1e1625e339299d568
3
  size 21382102
samples/hobellied-F2-accent-1.0.wav CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:d54ec87d6875cf6f3b3dd03094e80bec67287accc53cc9cceb0f0d9e72b1a77c
3
- size 316364
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e92cd08c80912cc25e9fc5da321c73c88cea1f9eb1ac1ceac993dab40baf688
3
+ size 326924
samples/hobellied-M2-accent-0.wav CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:98c98257cd67ae05d31b43273b53314b29fcded721f0670dae6819556d84b8ac
3
- size 264748
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:76b8a44e7bdb294c8f235eba10e1f27680ddd711dafca2340176e6ac086a84b3
3
+ size 266444
samples/hobellied-M2-accent-1.0.wav CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a277047db0b7cbb905262ab713f2c36eff71f765b1523ba2d9fed9ac2b0d4175
3
- size 316364
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0c35de0bf67716d18c8643055fd32fa7ef0bc62a9ed82fa279ee041843efdb18
3
+ size 325964
samples/hobellied-M2-accent-1.6.wav CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:759ff362f28d4652b5d928c15c654c7ee621f9d45fb9f9031797b102b1858bdb
3
- size 344684
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa5c9a14b0ec0f58d2a9609df6379ec73a4cd18a7ecfe1664948768dc2593ae5
3
+ size 338924
tinyvoca/g2p_de.py CHANGED
@@ -256,8 +256,28 @@ def _units(text):
256
  return out
257
 
258
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  def word(w, austrian=False):
260
  """One written word -> [(phone, stress), ...]."""
 
 
 
 
261
  if austrian and w in AUSTRIAN:
262
  return _units(AUSTRIAN[w])
263
  if w in EXCEPTIONS:
 
256
  return out
257
 
258
 
259
+ def _kaffee(w, units):
260
+ """"Kaffee" always with a long, stressed "ee" (as said in Austria; the unstressed eː came out short), also in
261
+ compounds: Kaffeetasse -> main stress on the ee, Eiskaffee -> secondary stress on it."""
262
+ if "kaffee" not in w.lower():
263
+ return units
264
+ phones = [u for u, _ in units]
265
+ for i in range(len(phones) - 3):
266
+ if phones[i:i + 4] == ["k", "a", "f", "eː"]:
267
+ lead = w.lower().startswith("kaffee")
268
+ out = [(u, 2 if lead and s == 1 else s) for u, s in units]
269
+ out[i + 1] = ("a", 0)
270
+ out[i + 3] = ("eː", 1 if lead else (units[i + 3][1] or 2))
271
+ return out
272
+ return units
273
+
274
+
275
  def word(w, austrian=False):
276
  """One written word -> [(phone, stress), ...]."""
277
+ return _kaffee(w, _word(w, austrian))
278
+
279
+
280
+ def _word(w, austrian=False):
281
  if austrian and w in AUSTRIAN:
282
  return _units(AUSTRIAN[w])
283
  if w in EXCEPTIONS:
web/apptor-tts.js CHANGED
@@ -153,7 +153,27 @@ export class G2P {
153
  }).filter(([u]) => u);
154
  }
155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
  async word(w, austrian = false) {
 
 
 
 
157
  if (austrian && this.austrian[w]) return G2P.units(this.austrian[w]);
158
  if (this.exceptions[w]) return G2P.units(this.exceptions[w]);
159
  if (this.cache.has(w)) return this.cache.get(w);
 
153
  }).filter(([u]) => u);
154
  }
155
 
156
+ // "Kaffee" always with a long, stressed "ee" (g2p_de.py _kaffee), also in compounds
157
+ static kaffee(w, units) {
158
+ if (!w.toLowerCase().includes("kaffee")) return units;
159
+ const ph = units.map(u => u[0]);
160
+ for (let i = 0; i + 3 < ph.length; i++) {
161
+ if (ph[i] === "k" && ph[i + 1] === "a" && ph[i + 2] === "f" && ph[i + 3] === "eː") {
162
+ const lead = w.toLowerCase().startsWith("kaffee");
163
+ const out = units.map(([u, s]) => [u, lead && s === 1 ? 2 : s]);
164
+ out[i + 1] = ["a", 0];
165
+ out[i + 3] = ["eː", lead ? 1 : (units[i + 3][1] || 2)];
166
+ return out;
167
+ }
168
+ }
169
+ return units;
170
+ }
171
+
172
  async word(w, austrian = false) {
173
+ return G2P.kaffee(w, await this.word1(w, austrian));
174
+ }
175
+
176
+ async word1(w, austrian = false) {
177
  if (austrian && this.austrian[w]) return G2P.units(this.austrian[w]);
178
  if (this.exceptions[w]) return G2P.units(this.exceptions[w]);
179
  if (this.cache.has(w)) return this.cache.get(w);
web/index.html CHANGED
@@ -84,7 +84,7 @@ footer a { color: #1d232b; font-weight: 600; }
84
  <header>
85
  <h1 id="greet">Servus!</h1>
86
  <p>Eine kleine deutsche Stimme, die auch (etwas) österreichisch kann. Direkt in deinem Browser.</p>
87
- <span class="ver">Version 0.1 · frühe Vorschau</span>
88
  </header>
89
 
90
  <section class="card" aria-label="Akzent">
@@ -149,7 +149,7 @@ und hobelt alles gleich.</textarea>
149
  <h2>Warum österreichisch?</h2>
150
  <p>Sprachausgaben klingen fast immer bundesdeutsch. apptor-tiny-tts soll eine Alternative sein, und zwar dort, wo große
151
  Modelle keinen Platz haben: im Browser, am Handy, in kleinen Apps. Der Akzent ist noch dezent und sitzt nicht in jedem
152
- Wort: besser als nichts, aber noch nicht ganz österreichisch. Das hier ist Version 0.1, trainiert auf einer einzigen Grafikkarte mit freien Aufnahmen von Freiwilligen
153
  aus <a href="https://commonvoice.mozilla.org/de" rel="noopener">Mozilla Common Voice</a>. Die beiden Stimmen sind
154
  synthetisch; das Modell hat den Tonfall gelernt, nicht die Stimmen der Sprecherinnen und Sprecher.</p>
155
  <p>Was hier passiert: Beim ersten Besuch lädt dein Browser einmalig rund 50 MB (Aussprache, Stimme, Klangfilter) und
@@ -181,7 +181,7 @@ und hobelt alles gleich.</textarea>
181
 
182
  <script type="module">
183
  import * as ort from "./ort/ort.wasm.min.mjs";
184
- import {G2P, makeFrontEnd, Voice} from "./apptor-tts.js?v=4";
185
 
186
  ort.env.wasm.wasmPaths = new URL("./ort/", location.href).href;
187
  ort.env.wasm.numThreads = self.crossOriginIsolated ? Math.min(4, navigator.hardwareConcurrency || 2) : 1;
@@ -244,7 +244,7 @@ async function fetchBytes(url, onProgress) {
244
  return out;
245
  }
246
 
247
- const SIZES = {"models/apptor-g2p-de.onnx": 12.4, "models/apptor-tiny-tts-at.onnx": 21.4, "models/apptor-vocos-de.int8.onnx": 16.7};
248
  const done = {};
249
  function progress(url, got, total) {
250
  done[url] = got / 1e6;
@@ -256,8 +256,8 @@ const json = async u => (await fetch(u)).json();
256
  const opts = {executionProviders: ["wasm"], graphOptimizationLevel: "all"};
257
 
258
  async function load() {
259
- const [F, exceptions, austrian, g2pMeta, ttsMeta] = await Promise.all(["frontend-de.json", "exceptions-de.json?v=2", "austrian-de.json", "models/apptor-g2p-de.json", "models/apptor-tiny-tts-at.json"].map(json));
260
- const [g2pBytes, ttsBytes] = await Promise.all(["models/apptor-g2p-de.onnx", "models/apptor-tiny-tts-at.onnx"].map(u => fetchBytes(u, (g, t) => progress(u, g, t))));
261
  const g2p = new G2P(ort, await ort.InferenceSession.create(g2pBytes, opts), g2pMeta, exceptions, austrian);
262
  voice = new Voice(ort, await ort.InferenceSession.create(ttsBytes, opts), ttsMeta, makeFrontEnd(F, g2p));
263
  $("speak").disabled = false; $("speak").textContent = "Sprechen";
 
84
  <header>
85
  <h1 id="greet">Servus!</h1>
86
  <p>Eine kleine deutsche Stimme, die auch (etwas) österreichisch kann. Direkt in deinem Browser.</p>
87
+ <span class="ver">Version 0.2 · frühe Vorschau</span>
88
  </header>
89
 
90
  <section class="card" aria-label="Akzent">
 
149
  <h2>Warum österreichisch?</h2>
150
  <p>Sprachausgaben klingen fast immer bundesdeutsch. apptor-tiny-tts soll eine Alternative sein, und zwar dort, wo große
151
  Modelle keinen Platz haben: im Browser, am Handy, in kleinen Apps. Der Akzent ist noch dezent und sitzt nicht in jedem
152
+ Wort: besser als nichts, aber noch nicht ganz österreichisch. Das hier ist Version 0.2, trainiert auf einer einzigen Grafikkarte mit freien Aufnahmen von Freiwilligen
153
  aus <a href="https://commonvoice.mozilla.org/de" rel="noopener">Mozilla Common Voice</a>. Die beiden Stimmen sind
154
  synthetisch; das Modell hat den Tonfall gelernt, nicht die Stimmen der Sprecherinnen und Sprecher.</p>
155
  <p>Was hier passiert: Beim ersten Besuch lädt dein Browser einmalig rund 50 MB (Aussprache, Stimme, Klangfilter) und
 
181
 
182
  <script type="module">
183
  import * as ort from "./ort/ort.wasm.min.mjs";
184
+ import {G2P, makeFrontEnd, Voice} from "./apptor-tts.js?v=5";
185
 
186
  ort.env.wasm.wasmPaths = new URL("./ort/", location.href).href;
187
  ort.env.wasm.numThreads = self.crossOriginIsolated ? Math.min(4, navigator.hardwareConcurrency || 2) : 1;
 
244
  return out;
245
  }
246
 
247
+ const SIZES = {"models/apptor-g2p-de.onnx": 12.4, "models/apptor-tiny-tts-at2.onnx": 21.4, "models/apptor-vocos-de.int8.onnx": 16.7};
248
  const done = {};
249
  function progress(url, got, total) {
250
  done[url] = got / 1e6;
 
256
  const opts = {executionProviders: ["wasm"], graphOptimizationLevel: "all"};
257
 
258
  async function load() {
259
+ const [F, exceptions, austrian, g2pMeta, ttsMeta] = await Promise.all(["frontend-de.json", "exceptions-de.json?v=2", "austrian-de.json", "models/apptor-g2p-de.json", "models/apptor-tiny-tts-at2.json"].map(json));
260
+ const [g2pBytes, ttsBytes] = await Promise.all(["models/apptor-g2p-de.onnx", "models/apptor-tiny-tts-at2.onnx"].map(u => fetchBytes(u, (g, t) => progress(u, g, t))));
261
  const g2p = new G2P(ort, await ort.InferenceSession.create(g2pBytes, opts), g2pMeta, exceptions, austrian);
262
  voice = new Voice(ort, await ort.InferenceSession.create(ttsBytes, opts), ttsMeta, makeFrontEnd(F, g2p));
263
  $("speak").disabled = false; $("speak").textContent = "Sprechen";
web/models/{apptor-tiny-tts-at.json → apptor-tiny-tts-at2.json} RENAMED
@@ -77,7 +77,7 @@
77
  ],
78
  "max_tokens": 512,
79
  "max_frames": 3000,
80
- "step": 126000,
81
  "frontend": "espeak",
82
  "frontend_fingerprint": "ddefc3ebfe4beeca2af195dc920c207110b07bd5067f225c575a3cdeef02d73f",
83
  "inputs": [
 
77
  ],
78
  "max_tokens": 512,
79
  "max_frames": 3000,
80
+ "step": 136000,
81
  "frontend": "espeak",
82
  "frontend_fingerprint": "ddefc3ebfe4beeca2af195dc920c207110b07bd5067f225c575a3cdeef02d73f",
83
  "inputs": [
web/models/{apptor-tiny-tts-at.onnx → apptor-tiny-tts-at2.onnx} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:1db856e5aac4f6b21f6b7f6e026a63fa8fb29469fa2301b8b166ffc5ebaae05d
3
  size 21382102
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a478c9827965aceadd03d812a74ecdaed856296fc2a577e1e1625e339299d568
3
  size 21382102