Fix build error
Browse files- backend/voice_presets.py +20 -20
- frontend/app.js +4 -4
- tests/test_voice_presets.py +33 -0
backend/voice_presets.py
CHANGED
|
@@ -1,31 +1,31 @@
|
|
| 1 |
VOICE_PRESETS = [
|
| 2 |
{
|
| 3 |
-
"id": "
|
| 4 |
-
"name": "
|
| 5 |
-
"desc": "Voice design preset 路
|
| 6 |
-
"initial": "
|
| 7 |
-
"instruct": "male, low pitch, british accent",
|
| 8 |
},
|
| 9 |
{
|
| 10 |
-
"id": "
|
| 11 |
-
"name": "
|
| 12 |
-
"desc": "Voice design preset 路
|
| 13 |
-
"initial": "
|
| 14 |
-
"instruct": "female, moderate pitch, british accent",
|
| 15 |
},
|
| 16 |
{
|
| 17 |
-
"id": "
|
| 18 |
-
"name": "
|
| 19 |
-
"desc": "Voice design preset 路
|
| 20 |
-
"initial": "
|
| 21 |
-
"instruct": "male, middle-aged, american accent",
|
| 22 |
},
|
| 23 |
{
|
| 24 |
-
"id": "
|
| 25 |
-
"name": "
|
| 26 |
-
"desc": "Voice design preset 路
|
| 27 |
-
"initial": "
|
| 28 |
-
"instruct": "female,
|
| 29 |
},
|
| 30 |
]
|
| 31 |
|
|
|
|
| 1 |
VOICE_PRESETS = [
|
| 2 |
{
|
| 3 |
+
"id": "the-archivist",
|
| 4 |
+
"name": "The Archivist",
|
| 5 |
+
"desc": "Voice design preset 路 elderly monk 路 low pitch 路 british accent",
|
| 6 |
+
"initial": "A",
|
| 7 |
+
"instruct": "male, elderly, low pitch, british accent",
|
| 8 |
},
|
| 9 |
{
|
| 10 |
+
"id": "the-novice",
|
| 11 |
+
"name": "The Novice",
|
| 12 |
+
"desc": "Voice design preset 路 young sister 路 moderate pitch 路 british accent",
|
| 13 |
+
"initial": "N",
|
| 14 |
+
"instruct": "female, young adult, moderate pitch, british accent",
|
| 15 |
},
|
| 16 |
{
|
| 17 |
+
"id": "the-warden",
|
| 18 |
+
"name": "The Warden",
|
| 19 |
+
"desc": "Voice design preset 路 stern keeper 路 very low pitch 路 american accent",
|
| 20 |
+
"initial": "W",
|
| 21 |
+
"instruct": "male, middle-aged, very low pitch, american accent",
|
| 22 |
},
|
| 23 |
{
|
| 24 |
+
"id": "the-illuminator",
|
| 25 |
+
"name": "The Illuminator",
|
| 26 |
+
"desc": "Voice design preset 路 bright scholar 路 high pitch 路 canadian accent",
|
| 27 |
+
"initial": "I",
|
| 28 |
+
"instruct": "female, middle-aged, high pitch, canadian accent",
|
| 29 |
},
|
| 30 |
]
|
| 31 |
|
frontend/app.js
CHANGED
|
@@ -3,10 +3,10 @@ import { Client, handle_file } from "https://esm.sh/@gradio/client";
|
|
| 3 |
const NARRATORS = globalThis.__VOICE_PRESETS__ || [];
|
| 4 |
const VOICE_DESIGN_OPTIONS = globalThis.__VOICE_DESIGN_OPTIONS__ || [];
|
| 5 |
const DEFAULT_NARRATOR = NARRATORS[0] || {
|
| 6 |
-
id: "
|
| 7 |
-
name: "
|
| 8 |
-
desc: "Voice design preset 路
|
| 9 |
-
initial: "
|
| 10 |
};
|
| 11 |
|
| 12 |
const VOICE_WARNING =
|
|
|
|
| 3 |
const NARRATORS = globalThis.__VOICE_PRESETS__ || [];
|
| 4 |
const VOICE_DESIGN_OPTIONS = globalThis.__VOICE_DESIGN_OPTIONS__ || [];
|
| 5 |
const DEFAULT_NARRATOR = NARRATORS[0] || {
|
| 6 |
+
id: "the-archivist",
|
| 7 |
+
name: "The Archivist",
|
| 8 |
+
desc: "Voice design preset 路 elderly monk 路 low pitch 路 british accent",
|
| 9 |
+
initial: "A",
|
| 10 |
};
|
| 11 |
|
| 12 |
const VOICE_WARNING =
|
tests/test_voice_presets.py
CHANGED
|
@@ -8,6 +8,39 @@ from backend.voice_design import VOICE_DESIGN_OPTIONS
|
|
| 8 |
from backend.voice_presets import VOICE_PRESETS
|
| 9 |
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
def test_voice_presets_use_only_supported_omnivoice_design_tokens() -> None:
|
| 12 |
for preset in VOICE_PRESETS:
|
| 13 |
instruct = preset["instruct"]
|
|
|
|
| 8 |
from backend.voice_presets import VOICE_PRESETS
|
| 9 |
|
| 10 |
|
| 11 |
+
def test_voice_presets_match_their_scriptorium_descriptions() -> None:
|
| 12 |
+
assert VOICE_PRESETS == [
|
| 13 |
+
{
|
| 14 |
+
"id": "the-archivist",
|
| 15 |
+
"name": "The Archivist",
|
| 16 |
+
"desc": "Voice design preset 路 elderly monk 路 low pitch 路 british accent",
|
| 17 |
+
"initial": "A",
|
| 18 |
+
"instruct": "male, elderly, low pitch, british accent",
|
| 19 |
+
},
|
| 20 |
+
{
|
| 21 |
+
"id": "the-novice",
|
| 22 |
+
"name": "The Novice",
|
| 23 |
+
"desc": "Voice design preset 路 young sister 路 moderate pitch 路 british accent",
|
| 24 |
+
"initial": "N",
|
| 25 |
+
"instruct": "female, young adult, moderate pitch, british accent",
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
"id": "the-warden",
|
| 29 |
+
"name": "The Warden",
|
| 30 |
+
"desc": "Voice design preset 路 stern keeper 路 very low pitch 路 american accent",
|
| 31 |
+
"initial": "W",
|
| 32 |
+
"instruct": "male, middle-aged, very low pitch, american accent",
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"id": "the-illuminator",
|
| 36 |
+
"name": "The Illuminator",
|
| 37 |
+
"desc": "Voice design preset 路 bright scholar 路 high pitch 路 canadian accent",
|
| 38 |
+
"initial": "I",
|
| 39 |
+
"instruct": "female, middle-aged, high pitch, canadian accent",
|
| 40 |
+
},
|
| 41 |
+
]
|
| 42 |
+
|
| 43 |
+
|
| 44 |
def test_voice_presets_use_only_supported_omnivoice_design_tokens() -> None:
|
| 45 |
for preset in VOICE_PRESETS:
|
| 46 |
instruct = preset["instruct"]
|