Add C++ support for streaming NeMo CTC models. (#857)

This commit is contained in:
Fangjun Kuang
2024-05-10 16:26:43 +08:00
committed by GitHub
parent 1eb60e8711
commit 46e4e5b7ac
22 changed files with 782 additions and 41 deletions

View File

@@ -100,7 +100,7 @@ class OnnxModel:
dtype=torch.float32,
).numpy()
self.cache_last_channel_len = torch.ones([1], dtype=torch.int64).numpy()
self.cache_last_channel_len = torch.zeros([1], dtype=torch.int64).numpy()
def __call__(self, x: np.ndarray):
# x: (T, C)

View File

@@ -142,7 +142,7 @@ class OnnxModel:
dtype=torch.float32,
).numpy()
self.cache_last_channel_len = torch.ones([1], dtype=torch.int64).numpy()
self.cache_last_channel_len = torch.zeros([1], dtype=torch.int64).numpy()
def run_encoder(self, x: np.ndarray):
# x: (T, C)