Add language identification swiftui demo (#729)

This commit is contained in:
yujinqiu
2024-04-01 20:34:14 +08:00
committed by GitHub
parent fabd30e3bb
commit f8832cb5f2
16 changed files with 1057 additions and 0 deletions

View File

@@ -48,6 +48,28 @@ func getBilingualStreamingZhEnParaformer() -> SherpaOnnxOnlineModelConfig {
)
}
// https://k2-fsa.github.io/sherpa/onnx/pretrained_models/whisper/tiny.en.html#tiny-en
//
func getLanguageIdentificationTiny() -> SherpaOnnxSpokenLanguageIdentificationConfig
{
let encoder = getResource("tiny-encoder.int8", "onnx")
let decoder = getResource("tiny-decoder.int8", "onnx")
let whisperConfig = sherpaOnnxSpokenLanguageIdentificationWhisperConfig(
encoder: encoder,
decoder: decoder
)
let config = sherpaOnnxSpokenLanguageIdentificationConfig(
whisper: whisperConfig,
numThreads: 1,
debug: 1,
provider: "cpu"
)
return config
}
/// Please refer to
/// https://k2-fsa.github.io/sherpa/onnx/pretrained_models/index.html
/// to add more models if you need