Skip to content

Commit

Permalink
More fixes to --context-size=1 (#566)
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj authored Apr 8, 2024
1 parent 98f9429 commit 4eac91c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sherpa/csrc/online-zipformer-transducer-model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ OnlineZipformerTransducerModel::OnlineZipformerTransducerModel(
joiner_ = model_.attr("joiner").toModule();

context_size_ =
decoder_.attr("conv").toModule().attr("weight").toTensor().size(2);
decoder_.hasattr("conv")
? decoder_.attr("conv").toModule().attr("weight").toTensor().size(2)
: 1;

// Use 7 here since the subsampling is ((len - 7) // 2 + 1) // 2.
int32_t pad_length = 7;
Expand Down

0 comments on commit 4eac91c

Please sign in to comment.