EveryVoiceTTS / EveryVoiceTTS/EveryVoice

everyvoice rename-speaker ( old speaker name defaults and error messages )

Open
#728 0 comments 0 reactions 1 assignee Claimed by @deltork View on GitHub
bug
Dominant language
Python
Stars
45
Forks
4
Avg merge
1d 8h
Merged PRs (30d)
14

Description

### Bug description

When we run :

` everyvoice rename-speaker`
or soon after PR722
`everyvoice checkpoint rename-speaker`

It expects the second argument to be the old speaker name and it is required.

If you give it a wrong speaker name , we get a kind of ungraceful error message. with " `ValueError: Speaker 'SPEAKER' not found in parameters. ` at the end.

I think instead we should capture the error and display the list of speaker names in the model and a proper error message instead of displaying code in the message. Also, I think it should be an command line `Option` instead with a default of `none`. If no old speaker name is given and the model is a single speaker model it will assume that is what you want to rename without the need to specify the single speaker name.

The help current help message says this below below:

```
everyvoice checkpoint rename-speaker -h

Usage: everyvoice checkpoint rename-speaker [OPTIONS] MODEL_PATH
OLD_SPEAKER_NAME NEW_SPEAKER_NAME

Rename a speaker in the checkpoint's parameters.


╭─ Arguments ───────────────────────────────────────────────────────────────────────────────╮
│ * model_path FILE The path to your model checkpoint file. │
│ [default: None] │
│ [required] │
│ * old_speaker_name TEXT The name of the speaker to rename. │
│ [default: None] │
│ [required] │
│ * new_speaker_name TEXT The new name for the speaker. │
│ [default: None] │
│ [required] │
╰───────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────╮
│ --help -h Show this message and exit. │
╰───────────────────────────────────────────────────────────────────────────────────────────╯

```

### How to reproduce the bug

```python
everyvoice checkpoint rename-speaker ./last.ckpt old new
```

### Error messages and logs

```
everyvoice checkpoint rename-speaker ./last.ckpt old new
╭─────────────────────────────────────────────────── Traceback (most recent call last) ───────────────────────────────────────────────────╮
│ /gpfs/fs5/nrc/nrc-fs1/ict/others/u/tes001/TxT2SPEECH/EveryVoice_722/everyvoice/base_cli/checkpoint.py:221 in rename_speaker │
│ │
│ 218 │ │ │ torch.save(ckpt, model_path) │
│ 219 │ │ │ print(f"Updated checkpoint saved to {model_path}.") │
│ 220 │ │ else: │
│ ❱ 221 │ │ │ raise ValueError(f"Speaker '{old_speaker_name}' not found in parameters.") │
│ 222 │ │
│ 223 │ else: │
│ 224 │ │ raise ValueError("No speakers found in checkpoint parameters.") │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: Speaker 'old' not found in parameters.

```

### Environment

latest

### More info

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.