Skip to content

Commit

Permalink
fix(vall-e-x): make audiopath relative to models (#1012)
Browse files Browse the repository at this point in the history
**Description**

This PR fixes #

**Notes for Reviewers**


**[Signed
commits](../CONTRIBUTING.md#signing-off-on-commits-developer-certificate-of-origin)**
- [ ] Yes, I signed my commits.
 

<!--
Thank you for contributing to LocalAI! 

Contributing Conventions:

1. Include descriptive PR titles with [<component-name>] prepended.
2. Build and test your changes before submitting a PR. 
3. Sign your commits

By following the community's contribution conventions upfront, the
review process will
be accelerated and your PR merged more quickly.
-->

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
  • Loading branch information
mudler authored Sep 5, 2023
1 parent 605c319 commit ee59e7d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion extra/grpc/vall-e-x/ttsvalle.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ def LoadModel(self, request, context):
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)
Expand Down

0 comments on commit ee59e7d

Please sign in to comment.