Skip to content

Commit aca16e4

Browse files
committed
fix: add preprocess paths to running config
1 parent f54de55 commit aca16e4

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

examples/conformer/config.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ decoder_config:
3131
beam_width: 0
3232
norm_score: True
3333
corpus_files:
34-
- /mnt/Data/MLDL/Datasets/ASR/Raw/LibriSpeech/train-clean-100/transcripts.tsv
34+
- /h/MLDL/Datasets/ASR/Raw/LibriSpeech/train-clean-100/transcripts.tsv
3535

3636
model_config:
3737
name: conformer
@@ -75,8 +75,8 @@ learning_config:
7575
num_masks: 1
7676
mask_factor: 27
7777
data_paths:
78-
- /mnt/Data/MLDL/Datasets/ASR/Raw/LibriSpeech/train-clean-100/transcripts.tsv
79-
tfrecords_dir: /mnt/Data/MLDL/Datasets/ASR/Raw/LibriSpeech/tfrecords_1030
78+
- /h/MLDL/Datasets/ASR/Raw/LibriSpeech/train-clean-100/transcripts.tsv
79+
tfrecords_dir: null
8080
shuffle: True
8181
cache: True
8282
buffer_size: 100
@@ -86,7 +86,7 @@ learning_config:
8686
eval_dataset_config:
8787
use_tf: True
8888
data_paths: null
89-
tfrecords_dir: /mnt/Data/MLDL/Datasets/ASR/Raw/LibriSpeech/tfrecords_1030
89+
tfrecords_dir: null
9090
shuffle: False
9191
cache: True
9292
buffer_size: 100
@@ -113,13 +113,13 @@ learning_config:
113113
batch_size: 2
114114
num_epochs: 50
115115
checkpoint:
116-
filepath: /mnt/Miscellanea/Models/local/conformer/checkpoints/{epoch:02d}.h5
116+
filepath: /d/Models/local/conformer/checkpoints/{epoch:02d}.h5
117117
save_best_only: False
118118
save_weights_only: True
119119
save_freq: epoch
120-
states_dir: /mnt/Miscellanea/Models/local/conformer/states
120+
states_dir: /d/Models/local/conformer/states
121121
tensorboard:
122-
log_dir: /mnt/Miscellanea/Models/local/conformer/tensorboard
122+
log_dir: /d/Models/local/conformer/tensorboard
123123
histogram_freq: 1
124124
write_graph: True
125125
write_images: True

tensorflow_asr/configs/config.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ def __init__(self, config: dict = None):
6767
self.num_epochs = config.pop("num_epochs", 20)
6868
for k, v in config.items():
6969
setattr(self, k, v)
70+
if k == "checkpoint":
71+
if v and v.get("filepath"):
72+
file_util.preprocess_paths(v.get("filepath"))
73+
elif k == "states_dir" and v:
74+
file_util.preprocess_paths(v)
75+
elif k == "tensorboard":
76+
if v and v.get("log_dir"):
77+
file_util.preprocess_paths(v.get("log_dir"))
7078

7179

7280
class LearningConfig:

0 commit comments

Comments
 (0)