mirror of
https://github.com/mudler/LocalAI.git
synced 2026-10-10 15:52:29 -04:00
* chore(parakeet-cpp): bump parakeet.cpp to 2de154c Brings in the speaker registry encoder fingerprint, the VAD segment trim and the opt-in word filter, a fix for a per-call thread count that stayed set on the process-wide backend after a Silero VAD pass, and bundle components loaded from memory. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code] * feat(parakeet-cpp): encoder fingerprint for speaker naming, vad_trim and guard_* options Speaker naming. A registered voice now carries the encoder that made it: the embedding family (voicedetect:<arch>:<name>:<dim>) and the sha256 of the weights. The backend reports the family of the loaded speaker model in Status, voice enrollment from speaker_profiles stores it as encoder_family (old entries load without it), and the registry sent to parakeet.cpp is built with parakeet_capi_speaker_registry_add_embedding_fp. The library then refuses a registry of another encoder family and the error names both families; another quantization of the same family only warns. A voice with only a weights hash gets the loaded family when the hashes are equal. Voices without a fingerprint (registered from audio: libvoicedetect cannot report one) keep the file-name rule and are used with a warning. The library cannot mix them with fingerprinted voices in one registry, so a request that has any uses the old registry for all. speaker_strict:true drops them instead. A library without the symbols behaves as before. Transcription. vad_trim (seconds, 0 keeps the whole cuts) goes through the VAD options JSON, so it reaches /v1/vad and the segmenter. The guard_* options guard_min_local_conf, guard_local_radius and guard_drop_punct_only turn on the word filter through parakeet_capi_transcribe_path_json_with, or through the segmenter with vad:true. They are off by default, bad values fail the load, and a library without the symbol fails it with a clear message. The dropped word count is logged at debug level. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code] --------- Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
33 lines
1.0 KiB
Go
33 lines
1.0 KiB
Go
// SPDX-License-Identifier: MIT
|
|
package main
|
|
|
|
import pb "github.com/mudler/LocalAI/pkg/grpc/proto"
|
|
|
|
// Status exposes only metadata derived from the loaded encoder. The native
|
|
// identity is borrowed, so copy it while holding the context lifetime lock.
|
|
func (p *ParakeetCpp) Status() (pb.StatusResponse, error) {
|
|
result, err := p.Base.Status()
|
|
if err != nil {
|
|
return pb.StatusResponse{}, err
|
|
}
|
|
p.engineMu.Lock()
|
|
defer p.engineMu.Unlock()
|
|
if p.spkCtx != 0 && CppSpeakerIdentity != nil && CppSpeakerDim != nil {
|
|
identity := CppSpeakerIdentity(p.spkCtx)
|
|
dim := CppSpeakerDim(p.spkCtx)
|
|
if identity != 0 && dim > 0 {
|
|
result.SpeakerEncoder = &pb.SpeakerEncoder{Identity: goStringFromCPtr(identity), Dimension: dim}
|
|
if CppSpeakerEncoderFamily != nil {
|
|
if family := CppSpeakerEncoderFamily(p.spkCtx); family != 0 {
|
|
result.SpeakerEncoder.Family = goStringFromCPtr(family)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return pb.StatusResponse{
|
|
State: result.GetState(),
|
|
Memory: result.GetMemory(),
|
|
SpeakerEncoder: result.GetSpeakerEncoder(),
|
|
}, nil
|
|
}
|