Skip to content

Commit cf3542a

Browse files
authored
Merge branch 'main' into feat/glm4-gptq-import
2 parents 98153fd + 68fdc67 commit cf3542a

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/mobius/models/nemo_rnnt.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def _forward_with_cache(
182182
new_cache = op.Slice(
183183
x_cat,
184184
op.Constant(value_ints=[-self._left_pad]),
185-
op.Constant(value_ints=[int(np.iinfo(np.int64).max)]),
185+
_dim(op, x_cat, 2),
186186
op.Constant(value_ints=[2]),
187187
)
188188
return out, new_cache
@@ -304,7 +304,7 @@ def _rel_shift(self, op: OpBuilder, x: ir.Value) -> ir.Value:
304304
x = op.Slice(
305305
x,
306306
op.Constant(value_ints=[1]),
307-
op.Constant(value_ints=[int(np.iinfo(np.int64).max)]),
307+
_dim(op, x, 2),
308308
op.Constant(value_ints=[2]),
309309
)
310310
# view back to (B, h, T, L)
@@ -520,7 +520,7 @@ def forward(
520520
new_channel = op.Slice(
521521
kv,
522522
op.Constant(value_ints=[-cache_len]),
523-
op.Constant(value_ints=[int(np.iinfo(np.int64).max)]),
523+
_dim(op, kv, 1),
524524
op.Constant(value_ints=[1]),
525525
) # last cache_len frames of concat(cache, att_in)
526526
else:
@@ -767,15 +767,14 @@ def _forward_streaming(
767767
"""
768768
de = self._drop_extra
769769
cache_size = self._cache_size
770-
intmax = int(np.iinfo(np.int64).max)
771770
x = self.pre_encode(op, audio_signal) # (B, T_sub, d)
772771
length_sub = self._subsampled_length(op, length) # (B,)
773772
# Drop the leading subsampled frames corrupted by chunk-boundary padding
774773
# (NeMo ``drop_extra_pre_encoded``), and shrink the lengths accordingly.
775774
x = op.Slice(
776775
x,
777776
op.Constant(value_ints=[de]),
778-
op.Constant(value_ints=[intmax]),
777+
_dim(op, x, 1),
779778
op.Constant(value_ints=[1]),
780779
) # (B, T_out, d)
781780
length_sub = op.Max(

0 commit comments

Comments
 (0)