Skip to content

Commit 72d85e5

Browse files
authored
Update model file extension (#1422)
* Update model file ext to ```.pth``` * Update docs * Rename more * Find model files
1 parent ccdc230 commit 72d85e5

29 files changed

+74
-103
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ venv.bak/
115115
*.swo
116116

117117
# pytorch models
118+
*.pth
118119
*.pth.tar
119120
result/
120121

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,13 @@ If you are on Windows, 👑@GuyPaddock wrote installation instructions [here](ht
159159
- Run your own TTS model (Using Griffin-Lim Vocoder):
160160
161161
```
162-
$ tts --text "Text for TTS" --model_path path/to/model.pth.tar --config_path path/to/config.json --out_path output/path/speech.wav
162+
$ tts --text "Text for TTS" --model_path path/to/model.pth --config_path path/to/config.json --out_path output/path/speech.wav
163163
```
164164
165165
- Run your own TTS and Vocoder models:
166166
```
167-
$ tts --text "Text for TTS" --model_path path/to/config.json --config_path path/to/model.pth.tar --out_path output/path/speech.wav
168-
--vocoder_path path/to/vocoder.pth.tar --vocoder_config_path path/to/vocoder_config.json
167+
$ tts --text "Text for TTS" --model_path path/to/config.json --config_path path/to/model.pth --out_path output/path/speech.wav
168+
--vocoder_path path/to/vocoder.pth --vocoder_config_path path/to/vocoder_config.json
169169
```
170170
171171
### Multi-speaker Models
@@ -185,7 +185,7 @@ If you are on Windows, 👑@GuyPaddock wrote installation instructions [here](ht
185185
- Run your own multi-speaker TTS model:
186186
187187
```
188-
$ tts --text "Text for TTS" --out_path output/path/speech.wav --model_path path/to/config.json --config_path path/to/model.pth.tar --speakers_file_path path/to/speaker.json --speaker_idx <speaker_id>
188+
$ tts --text "Text for TTS" --out_path output/path/speech.wav --model_path path/to/config.json --config_path path/to/model.pth --speakers_file_path path/to/speaker.json --speaker_idx <speaker_id>
189189
```
190190
191191
## Directory Structure

TTS/bin/compute_attention_masks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"""
2626
Example run:
2727
CUDA_VISIBLE_DEVICE="0" python TTS/bin/compute_attention_masks.py
28-
--model_path /data/rw/home/Models/ljspeech-dcattn-December-14-2020_11+10AM-9d0e8c7/checkpoint_200000.pth.tar
28+
--model_path /data/rw/home/Models/ljspeech-dcattn-December-14-2020_11+10AM-9d0e8c7/checkpoint_200000.pth
2929
--config_path /data/rw/home/Models/ljspeech-dcattn-December-14-2020_11+10AM-9d0e8c7/config.json
3030
--dataset_metafile metadata.csv
3131
--data_path /root/LJSpeech-1.1/

TTS/bin/compute_embeddings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
description="""Compute embedding vectors for each wav file in a dataset.\n\n"""
1313
"""
1414
Example runs:
15-
python TTS/bin/compute_embeddings.py speaker_encoder_model.pth.tar speaker_encoder_config.json dataset_config.json embeddings_output_path/
15+
python TTS/bin/compute_embeddings.py speaker_encoder_model.pth speaker_encoder_config.json dataset_config.json embeddings_output_path/
1616
""",
1717
formatter_class=RawTextHelpFormatter,
1818
)

TTS/bin/distribute.py

Lines changed: 0 additions & 55 deletions
This file was deleted.

TTS/bin/eval_encoder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def compute_encoder_accuracy(dataset_items, encoder_manager):
5656
description="""Compute the accuracy of the encoder.\n\n"""
5757
"""
5858
Example runs:
59-
python TTS/bin/eval_encoder.py emotion_encoder_model.pth.tar emotion_encoder_config.json dataset_config.json
59+
python TTS/bin/eval_encoder.py emotion_encoder_model.pth emotion_encoder_config.json dataset_config.json
6060
""",
6161
formatter_class=RawTextHelpFormatter,
6262
)

TTS/bin/synthesize.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ def main():
6060
- Run your own TTS model (Using Griffin-Lim Vocoder):
6161
6262
```
63-
$ tts --text "Text for TTS" --model_path path/to/model.pth.tar --config_path path/to/config.json --out_path output/path/speech.wav
63+
$ tts --text "Text for TTS" --model_path path/to/model.pth --config_path path/to/config.json --out_path output/path/speech.wav
6464
```
6565
6666
- Run your own TTS and Vocoder models:
6767
```
68-
$ tts --text "Text for TTS" --model_path path/to/config.json --config_path path/to/model.pth.tar --out_path output/path/speech.wav
69-
--vocoder_path path/to/vocoder.pth.tar --vocoder_config_path path/to/vocoder_config.json
68+
$ tts --text "Text for TTS" --model_path path/to/config.json --config_path path/to/model.pth --out_path output/path/speech.wav
69+
--vocoder_path path/to/vocoder.pth --vocoder_config_path path/to/vocoder_config.json
7070
```
7171
7272
### Multi-speaker Models
@@ -86,7 +86,7 @@ def main():
8686
- Run your own multi-speaker TTS model:
8787
8888
```
89-
$ tts --text "Text for TTS" --out_path output/path/speech.wav --model_path path/to/config.json --config_path path/to/model.pth.tar --speakers_file_path path/to/speaker.json --speaker_idx <speaker_id>
89+
$ tts --text "Text for TTS" --out_path output/path/speech.wav --model_path path/to/config.json --config_path path/to/model.pth --speakers_file_path path/to/speaker.json --speaker_idx <speaker_id>
9090
```
9191
"""
9292
# We remove Markdown code formatting programmatically here to allow us to copy-and-paste from main README to keep

TTS/encoder/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ To run the code, you need to follow the same flow as in TTS.
1414

1515
- Define 'config.json' for your needs. Note that, audio parameters should match your TTS model.
1616
- Example training call ```python speaker_encoder/train.py --config_path speaker_encoder/config.json --data_path ~/Data/Libri-TTS/train-clean-360```
17-
- Generate embedding vectors ```python speaker_encoder/compute_embeddings.py --use_cuda true /model/path/best_model.pth.tar model/config/path/config.json dataset/path/ output_path``` . This code parses all .wav files at the given dataset path and generates the same folder structure under the output path with the generated embedding files.
17+
- Generate embedding vectors ```python speaker_encoder/compute_embeddings.py --use_cuda true /model/path/best_model.pth model/config/path/config.json dataset/path/ output_path``` . This code parses all .wav files at the given dataset path and generates the same folder structure under the output path with the generated embedding files.
1818
- Watch training on Tensorboard as in TTS

TTS/encoder/utils/generic_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def setup_speaker_encoder_model(config: "Coqpit"):
147147

148148

149149
def save_checkpoint(model, optimizer, criterion, model_loss, out_path, current_step, epoch):
150-
checkpoint_path = "checkpoint_{}.pth.tar".format(current_step)
150+
checkpoint_path = "checkpoint_{}.pth".format(current_step)
151151
checkpoint_path = os.path.join(out_path, checkpoint_path)
152152
print(" | | > Checkpoint saving : {}".format(checkpoint_path))
153153

@@ -177,7 +177,7 @@ def save_best_model(model, optimizer, criterion, model_loss, best_loss, out_path
177177
"date": datetime.date.today().strftime("%B %d, %Y"),
178178
}
179179
best_loss = model_loss
180-
bestmodel_path = "best_model.pth.tar"
180+
bestmodel_path = "best_model.pth"
181181
bestmodel_path = os.path.join(out_path, bestmodel_path)
182182
print("\n > BEST MODEL ({0:.5f}) : {1:}".format(model_loss, bestmodel_path))
183183
save_fsspec(state, bestmodel_path)

TTS/encoder/utils/io.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
def save_checkpoint(model, optimizer, model_loss, out_path, current_step):
8-
checkpoint_path = "checkpoint_{}.pth.tar".format(current_step)
8+
checkpoint_path = "checkpoint_{}.pth".format(current_step)
99
checkpoint_path = os.path.join(out_path, checkpoint_path)
1010
print(" | | > Checkpoint saving : {}".format(checkpoint_path))
1111

@@ -31,7 +31,7 @@ def save_best_model(model, optimizer, model_loss, best_loss, out_path, current_s
3131
"date": datetime.date.today().strftime("%B %d, %Y"),
3232
}
3333
best_loss = model_loss
34-
bestmodel_path = "best_model.pth.tar"
34+
bestmodel_path = "best_model.pth"
3535
bestmodel_path = os.path.join(out_path, bestmodel_path)
3636
print("\n > BEST MODEL ({0:.5f}) : {1:}".format(model_loss, bestmodel_path))
3737
save_fsspec(state, bestmodel_path)

0 commit comments

Comments
 (0)