| | |
| | | } |
| | | } |
| | | |
| | | func TestOfflineConfigForSenseVoiceYueSetsLanguageParam(t *testing.T) { |
| | | root := t.TempDir() |
| | | files := map[string]string{ |
| | | "model": filepath.Join(root, "model.int8.onnx"), |
| | | "tokens": filepath.Join(root, "tokens.txt"), |
| | | } |
| | | resolved := model.ResolvedModel{ |
| | | ModelID: model.SenseVoiceYueModelID, |
| | | BackendKind: model.BackendSenseVoice, |
| | | Profile: model.ModelProfile{ |
| | | DisplayName: "SenseVoice Yue", |
| | | BackendKind: model.BackendSenseVoice, |
| | | LanguageParam: "yue", |
| | | ProviderOrder: []string{"cpu"}, |
| | | NumThreads: 4, |
| | | }, |
| | | Files: files, |
| | | } |
| | | |
| | | config, err := offlineConfigForResolvedModel(resolved, "cpu") |
| | | if err != nil { |
| | | t.Fatal(err) |
| | | } |
| | | if config.ModelConfig.SenseVoice.Model != files["model"] { |
| | | t.Fatalf("model = %q, want %q", config.ModelConfig.SenseVoice.Model, files["model"]) |
| | | } |
| | | if config.ModelConfig.SenseVoice.Language != "yue" { |
| | | t.Fatalf("language = %q, want yue", config.ModelConfig.SenseVoice.Language) |
| | | } |
| | | if config.ModelConfig.Tokens != files["tokens"] { |
| | | t.Fatalf("tokens = %q, want %q", config.ModelConfig.Tokens, files["tokens"]) |
| | | } |
| | | } |
| | | |
| | | func TestOnlineConfigForXASRUsesStreamingTransducer(t *testing.T) { |
| | | root := t.TempDir() |
| | | files := map[string]string{ |