From ee59e7d45f06e5cf40ade730df858882c43914ed Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Tue, 5 Sep 2023 19:33:36 +0200 Subject: [PATCH] fix(vall-e-x): make audiopath relative to models (#1012) **Description** This PR fixes # **Notes for Reviewers** **[Signed commits](../CONTRIBUTING.md#signing-off-on-commits-developer-certificate-of-origin)** - [ ] Yes, I signed my commits. Signed-off-by: Ettore Di Giacinto --- extra/grpc/vall-e-x/ttsvalle.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/extra/grpc/vall-e-x/ttsvalle.py b/extra/grpc/vall-e-x/ttsvalle.py index dd12955e..714a3415 100644 --- a/extra/grpc/vall-e-x/ttsvalle.py +++ b/extra/grpc/vall-e-x/ttsvalle.py @@ -26,7 +26,13 @@ class BackendServicer(backend_pb2_grpc.BackendServicer): print("Preparing models, please wait", file=sys.stderr) # download and load all models preload_models() - + # Assume directory from request.ModelFile. + # Only if request.LoraAdapter it's not an absolute path + if request.AudioPath and request.ModelFile != "" and not os.path.isabs(request.AudioPath): + # get base path of modelFile + modelFileBase = os.path.dirname(request.ModelFile) + # modify LoraAdapter to be relative to modelFileBase + request.AudioPath = os.path.join(modelFileBase, request.AudioPath) if request.AudioPath != "": print("Generating model", file=sys.stderr) make_prompt(name=model_name, audio_prompt_path=request.AudioPath)