From 5cfb4ecccdec909fd4e92b8e8c833dd33870d38e Mon Sep 17 00:00:00 2001 From: Enno Hermann Date: Tue, 3 Dec 2024 22:09:03 +0100 Subject: [PATCH] refactor(api): require keyword arguments except for model_name --- TTS/api.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/TTS/api.py b/TTS/api.py index 86787e03..62dab329 100644 --- a/TTS/api.py +++ b/TTS/api.py @@ -2,6 +2,7 @@ import logging import tempfile import warnings from pathlib import Path +from typing import Optional from torch import nn @@ -19,12 +20,13 @@ class TTS(nn.Module): def __init__( self, model_name: str = "", - model_path: str = None, - config_path: str = None, - vocoder_path: str = None, - vocoder_config_path: str = None, + *, + model_path: Optional[str] = None, + config_path: Optional[str] = None, + vocoder_path: Optional[str] = None, + vocoder_config_path: Optional[str] = None, progress_bar: bool = True, - gpu=False, + gpu: bool = False, ): """🐸TTS python interface that allows to load and use the released models.