Skip to content

Commit

Permalink
Update train_char.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JinZr committed Mar 13, 2024
1 parent 4413713 commit 9bf88ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion egs/commonvoice/ASR/zipformer/train_char.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
get_parameter_groups_with_lrs,
setup_logger,
str2bool,
tokenize_by_CJK_char,
)

LRSchedulerType = Union[torch.optim.lr_scheduler._LRScheduler, optim.LRScheduler]
Expand Down Expand Up @@ -356,7 +357,7 @@ def compute_loss(
batch_idx_train = params.batch_idx_train
warm_step = params.warm_step

texts = batch["supervisions"]["text"]
texts = [tokenize_by_CJK_char(text) for text in batch["supervisions"]["text"]]
y = graph_compiler.texts_to_ids(texts)
y = k2.RaggedTensor(y).to(device)

Expand Down

0 comments on commit 9bf88ac

Please sign in to comment.