mirror of
https://github.com/mudler/LocalAI.git
synced 2026-07-31 10:28:43 -04:00
[voice] feat: add managed voice cloning profiles (#10799)
* feat(ui): add voice library workflow Give administrators a production-ready flow to record or upload consented reference audio, manage reusable profiles, inspect API usage, discover compatible models, and hand a saved voice directly to text-to-speech. Assisted-by: Codex:gpt-5 * feat(voice): add managed voice cloning profiles Make reusable reference voices manageable through the admin API instead of requiring model-directory and YAML edits. Discover compatible installed and gallery models from server-side backend capabilities, retain explicit model configuration controls, and stage saved references for supported backends. Expose profile management through REST and MCP, document backend-specific behavior, and cover the workflow from profile creation through real Qwen3-TTS synthesis. Harden the agent-job HTTP test against completion racing cancellation. Assisted-by: Codex:gpt-5 --------- Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
@@ -119,9 +119,18 @@ class BackendServicer(backend_pb2_grpc.BackendServicer):
|
||||
# add options to kwargs
|
||||
kwargs.update(self.options)
|
||||
|
||||
ref_codes = self.model.encode_reference(self.AudioPath)
|
||||
ref_audio = request.voice if request.voice else self.AudioPath
|
||||
if not ref_audio:
|
||||
return backend_pb2.Result(success=False, message="reference audio is required")
|
||||
ref_text = request.params.get("ref_text") if hasattr(request, "params") else None
|
||||
if not ref_text:
|
||||
ref_text = self.ref_text
|
||||
if not ref_text:
|
||||
return backend_pb2.Result(success=False, message="ref_text is required")
|
||||
|
||||
wav = self.model.infer(request.text, ref_codes, self.ref_text)
|
||||
ref_codes = self.model.encode_reference(ref_audio)
|
||||
|
||||
wav = self.model.infer(request.text, ref_codes, ref_text)
|
||||
|
||||
sf.write(request.dst, wav, 24000)
|
||||
except Exception as err:
|
||||
|
||||
Reference in New Issue
Block a user