paddlespeech.resource.resource module

class paddlespeech.resource.resource.CommonTaskResource(task: str, model_format: str = 'dynamic', **kwargs)[source]

Bases: object

Methods

get_model_class(model_name)

Dynamic import model class. Args: model_name (str): Model name.

get_versions(model_tag)

List all available versions.

set_task_model(model_tag[, model_type, ...])

Set model tag and version of current task.

static get_model_class(model_name) List[object][source]

Dynamic import model class. Args:

model_name (str): Model name.

Returns:

List[object]: Return a list of model class.

get_versions(model_tag: str) List[str][source]

List all available versions.

Args:

model_tag (str): Model tag.

Returns:

List[str]: Version list of model.

set_task_model(model_tag: str, model_type: int = 0, skip_download: bool = False, version: Optional[str] = None)[source]

Set model tag and version of current task.

Args:

model_tag (str): Model tag. model_type (int): 0 for acoustic model otherwise vocoder in tts task. version (Optional[str], optional): Version of pretrained model. Defaults to None.