fix: Resolve model loading and deployment issues
This commit fixes several critical issues that prevented the service from deploying correctly and loading the TTS models. - **Fix Model Loading:** Corrected the volume mount path in to point to the correct source directory. The engine code was also updated to use absolute paths () inside the container, making the model loading mechanism robust. - **Update Session Resume:** The has been updated to reflect the final debugging steps and the successful resolution of all issues.
This commit is contained in:
@ -29,7 +29,7 @@ class PiperEngine(TTSEngineBase):
|
||||
|
||||
def _load_config(self, model: str):
|
||||
"""Load the model config JSON file to get speaker mappings."""
|
||||
model_dir = f"./app/models/piper/{model}"
|
||||
model_dir = f"/models/piper/{model}"
|
||||
config_file = os.path.join(model_dir, f"{model}.onnx.json")
|
||||
if os.path.isfile(config_file):
|
||||
with open(config_file, 'r') as f:
|
||||
@ -60,7 +60,7 @@ class PiperEngine(TTSEngineBase):
|
||||
raise RuntimeError("Piper executable not found. Please install it and ensure it's in your PATH.")
|
||||
if not model:
|
||||
raise ValueError("Model must be specified for Piper.")
|
||||
model_dir = f"./app/models/piper/{model}"
|
||||
model_dir = f"/models/piper/{model}"
|
||||
model_file = os.path.join(model_dir, f"{model}.onnx")
|
||||
if not os.path.isfile(model_file):
|
||||
raise FileNotFoundError(f"Piper model not found: {model_file}")
|
||||
@ -108,7 +108,7 @@ class PiperEngine(TTSEngineBase):
|
||||
return output_other_path
|
||||
|
||||
def list_models(self):
|
||||
models_dir = "./app/models/piper/"
|
||||
models_dir = "/models/piper/"
|
||||
if not os.path.isdir(models_dir):
|
||||
return []
|
||||
return [name for name in os.listdir(models_dir)
|
||||
|
||||
Reference in New Issue
Block a user