mirror of
https://github.com/twinksoftware/Gearslip.git
synced 2026-11-11 00:12:24 +01:00
voice: Canary 180M as a middle choice for the final words
This commit is contained in:
1 parent
e76e9ddcf7
commit
000ca85479
3 files changed
+24
-8
No files matched your search
@@ -17,6 +17,7 @@ import app.seb3thehacker.gearslip.audio.CarMic
|
|||||||
import com.k2fsa.sherpa.onnx.EndpointConfig
|
import com.k2fsa.sherpa.onnx.EndpointConfig
|
||||||
import com.k2fsa.sherpa.onnx.EndpointRule
|
import com.k2fsa.sherpa.onnx.EndpointRule
|
||||||
import com.k2fsa.sherpa.onnx.FeatureConfig
|
import com.k2fsa.sherpa.onnx.FeatureConfig
|
||||||
|
import com.k2fsa.sherpa.onnx.OfflineCanaryModelConfig
|
||||||
import com.k2fsa.sherpa.onnx.OfflineModelConfig
|
import com.k2fsa.sherpa.onnx.OfflineModelConfig
|
||||||
import com.k2fsa.sherpa.onnx.OfflineRecognizer
|
import com.k2fsa.sherpa.onnx.OfflineRecognizer
|
||||||
import com.k2fsa.sherpa.onnx.OfflineRecognizerConfig
|
import com.k2fsa.sherpa.onnx.OfflineRecognizerConfig
|
||||||
@@ -284,12 +285,21 @@ object SpeechEngine {
|
|||||||
OfflineRecognizer(
|
OfflineRecognizer(
|
||||||
config = OfflineRecognizerConfig(
|
config = OfflineRecognizerConfig(
|
||||||
featConfig = FeatureConfig(sampleRate = RATE, featureDim = 80),
|
featConfig = FeatureConfig(sampleRate = RATE, featureDim = 80),
|
||||||
modelConfig = OfflineModelConfig(
|
modelConfig = if (model.modelType == "canary") {
|
||||||
transducer = OfflineTransducerModelConfig(path(model.encoder), path(model.decoder), path(model.joiner)),
|
// English in, English out, and no punctuation: clean() strips it anyway.
|
||||||
tokens = path("tokens.txt"),
|
OfflineModelConfig(
|
||||||
numThreads = threads(),
|
canary = OfflineCanaryModelConfig(path(model.encoder), path(model.decoder), srcLang = "en", tgtLang = "en", usePnc = false),
|
||||||
modelType = model.modelType,
|
tokens = path("tokens.txt"),
|
||||||
),
|
numThreads = threads(),
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
OfflineModelConfig(
|
||||||
|
transducer = OfflineTransducerModelConfig(path(model.encoder), path(model.decoder), path(model.joiner)),
|
||||||
|
tokens = path("tokens.txt"),
|
||||||
|
numThreads = threads(),
|
||||||
|
modelType = model.modelType,
|
||||||
|
)
|
||||||
|
},
|
||||||
decodingMethod = "greedy_search",
|
decodingMethod = "greedy_search",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ object SpeechModels {
|
|||||||
private val archive: String,
|
private val archive: String,
|
||||||
val encoder: String,
|
val encoder: String,
|
||||||
val decoder: String,
|
val decoder: String,
|
||||||
|
/** Empty for Canary, which decodes with attention and has no joiner. */
|
||||||
val joiner: String,
|
val joiner: String,
|
||||||
val modelType: String = "",
|
val modelType: String = "",
|
||||||
) {
|
) {
|
||||||
@@ -44,6 +45,11 @@ object SpeechModels {
|
|||||||
"sherpa-onnx-nemo-parakeet_tdt_transducer_110m-en-36000-int8",
|
"sherpa-onnx-nemo-parakeet_tdt_transducer_110m-en-36000-int8",
|
||||||
"encoder.int8.onnx", "decoder.int8.onnx", "joiner.int8.onnx", modelType = "nemo_transducer",
|
"encoder.int8.onnx", "decoder.int8.onnx", "joiner.int8.onnx", modelType = "nemo_transducer",
|
||||||
),
|
),
|
||||||
|
CANARY(
|
||||||
|
Role.FINAL, "canary-180m-en", "Canary", "In between: better than Parakeet small, quicker than large. NVIDIA NeMo, CC BY 4.0", 154,
|
||||||
|
"sherpa-onnx-nemo-canary-180m-flash-en-es-de-fr-int8",
|
||||||
|
"encoder.int8.onnx", "decoder.int8.onnx", "", modelType = "canary",
|
||||||
|
),
|
||||||
PARAKEET_LARGE(
|
PARAKEET_LARGE(
|
||||||
Role.FINAL, "parakeet-0.6b-en", "Parakeet large", "Recommended. Hears names and places best. NVIDIA NeMo, CC BY 4.0", 460,
|
Role.FINAL, "parakeet-0.6b-en", "Parakeet large", "Recommended. Hears names and places best. NVIDIA NeMo, CC BY 4.0", 460,
|
||||||
"sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-int8",
|
"sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-int8",
|
||||||
@@ -52,7 +58,7 @@ object SpeechModels {
|
|||||||
;
|
;
|
||||||
|
|
||||||
val url get() = "https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/$archive.tar.bz2"
|
val url get() = "https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/$archive.tar.bz2"
|
||||||
val files get() = listOf(encoder, decoder, joiner, "tokens.txt")
|
val files get() = listOf(encoder, decoder, joiner, "tokens.txt").filter { it.isNotEmpty() }
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed interface State {
|
sealed interface State {
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ internal fun AboutLinkRows() {
|
|||||||
SettingsRow(
|
SettingsRow(
|
||||||
"Voice credits",
|
"Voice credits",
|
||||||
subtitle = "Speech recognition by sherpa-onnx (Apache 2.0), with Kroko ASR by Banafo " +
|
subtitle = "Speech recognition by sherpa-onnx (Apache 2.0), with Kroko ASR by Banafo " +
|
||||||
"(CC BY-SA 4.0) and Parakeet by NVIDIA (CC BY 4.0)",
|
"(CC BY-SA 4.0), and Parakeet and Canary by NVIDIA (CC BY 4.0)",
|
||||||
icon = Icons.Filled.Favorite,
|
icon = Icons.Filled.Favorite,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user