(ml *model.ModelLoader, modelConfig config.ModelConfig, appConfig *config.ApplicationConfig)
| 46 | } |
| 47 | |
| 48 | func loadDiarizationModel(ml *model.ModelLoader, modelConfig config.ModelConfig, appConfig *config.ApplicationConfig) (grpcPkg.Backend, error) { |
| 49 | if modelConfig.Backend == "" { |
| 50 | return nil, fmt.Errorf("diarization: model %q has no backend set; supported backends include vibevoice-cpp and sherpa-onnx", modelConfig.Name) |
| 51 | } |
| 52 | opts := ModelOptions(modelConfig, appConfig) |
| 53 | m, err := ml.Load(opts...) |
| 54 | if err != nil { |
| 55 | recordModelLoadFailure(appConfig, modelConfig.Name, modelConfig.Backend, err, nil) |
| 56 | return nil, err |
| 57 | } |
| 58 | if m == nil { |
| 59 | return nil, fmt.Errorf("could not load diarization model") |
| 60 | } |
| 61 | return m, nil |
| 62 | } |
| 63 | |
| 64 | // ModelDiarization runs the Diarize RPC against the configured backend |
| 65 | // and returns a normalized schema.DiarizationResult. |
no test coverage detected