k2-fsa / sherpa

Speech-to-text server framework with next-gen Kaldi
https://k2-fsa.github.io/sherpa
Apache License 2.0
474 stars 97 forks source link

Support --context-size=1 #565

Closed csukuangfj closed 2 months ago

csukuangfj commented 2 months ago

When --context-size is 1, there is no conv module at all.

It fixes the following error

[I] /xxxx/sherpa/cpp_api/bin/online-recognizer.cc:143:int32_t main(int32_t, char**) 2024-04-08 14:07:07.958 decoding method: greedy_search
terminate called after throwing an instance of 'torch::jit::ObjectAttributeError'
  what():  __torch__.torch.nn.modules.linear.Identity (of Python compilation unit at: 0x556bd40) does not have a field with name 'weight'