Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/speech/app/text-to-speech/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ const STEPS_OPTIONS = [
const MODEL_OPTIONS = [
{ label: 'XNNPACK (CPU)', value: 'XNNPACK_FP32' as const },
{ label: 'MLX (Apple Silicon)', value: 'MLX_FP32' as const, disabled: Platform.OS !== 'ios' },
{ label: 'Vulkan (GPU)', value: 'VULKAN_FP16' as const, disabled: Platform.OS !== 'android' },
];

function TTSContent() {
const [text, setText] = useState(SAMPLE_TEXT);
const [selectedModel, setSelectedModel] = useState<'XNNPACK_FP32' | 'MLX_FP32'>('XNNPACK_FP32');
const [selectedModel, setSelectedModel] = useState<'XNNPACK_FP32' | 'MLX_FP32' | 'VULKAN_FP16'>(
Platform.OS === 'android' ? 'VULKAN_FP16' : 'XNNPACK_FP32'
);
const [selectedVoice, setSelectedVoice] = useState<SupertonicDefaultVoiceName>('F1');
const [selectedLang, setSelectedLang] = useState<speech.SupertonicLanguage>('en');
const [speed, setSpeed] = useState(1.05);
Expand Down
8 changes: 6 additions & 2 deletions packages/react-native-executorch/scripts/download-libs.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,12 @@ const FEATURE_MAP = {
privacyFilter: { backends: ['xnnpack', 'mlx'], libs: [] },
// Whisper ships xnnpack, coreml, an MLX iOS export and a Vulkan Android one.
speechToText: { backends: ['xnnpack', 'coreml', 'mlx', 'vulkan'], libs: [] },
// Kokoro ships xnnpack + coreml; Supertonic adds an MLX iOS export.
textToSpeech: { backends: ['xnnpack', 'coreml', 'mlx'], libs: ['phonemis'] },
// Kokoro ships xnnpack + coreml; Supertonic adds an MLX iOS export and a
// Vulkan Android one.
textToSpeech: {
backends: ['xnnpack', 'coreml', 'mlx', 'vulkan'],
libs: ['phonemis'],
},
// FSMN VAD — xnnpack only.
vad: { backends: ['xnnpack'], libs: [] },
// The MiniLM/CLIP-text/distiluse family ships coreml alongside xnnpack,
Expand Down
13 changes: 13 additions & 0 deletions packages/react-native-executorch/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,18 @@ const SUPERTONIC_3_MLX_FP32: SupertonicTtsModel<SupertonicDefaultVoiceName> = {
voiceStyles: SUPERTONIC_DEFAULT_VOICE_STYLES,
};

const SUPERTONIC_3_VULKAN_FP16: SupertonicTtsModel<SupertonicDefaultVoiceName> = {
name: 'supertonic',
modelPaths: {
durationPredictor: `${BASE_URL}-supertonic/${NEXT_VERSION_TAG}/vulkan/duration_predictor_vulkan_fp16.pte`,
vectorEstimator: `${BASE_URL}-supertonic/${NEXT_VERSION_TAG}/vulkan/vector_estimator_vulkan_fp16.pte`,
textEncoder: `${BASE_URL}-supertonic/${NEXT_VERSION_TAG}/vulkan/text_encoder_vulkan_fp16.pte`,
vocoder: `${BASE_URL}-supertonic/${NEXT_VERSION_TAG}/vulkan/vocoder_vulkan_fp16.pte`,
},
unicodeIndexerPath: `${BASE_URL}-supertonic/${NEXT_VERSION_TAG}/unicode_indexer.json`,
voiceStyles: SUPERTONIC_DEFAULT_VOICE_STYLES,
};

const KOKORO_ROOT = `${BASE_URL}-kokoro/${NEXT_VERSION_TAG}`;
const KOKORO_PHONEMIZER_ROOT = `${KOKORO_ROOT}/phonemizer`;

Expand Down Expand Up @@ -2624,6 +2636,7 @@ export const models = {
SUPERTONIC: variants({
XNNPACK_FP32: SUPERTONIC_3_XNNPACK_FP32,
MLX_FP32: SUPERTONIC_3_MLX_FP32,
VULKAN_FP16: SUPERTONIC_3_VULKAN_FP16,
}),

/**
Expand Down