Skip to content

Commit 131ed30

Browse files
committed
Remove NumPy 2.0 constraint from ctc_segmentation requirements
1 parent a035e05 commit 131ed30

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

nemo/collections/asr/parts/preprocessing/segment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,10 @@ def _convert_samples_to_float32(samples):
263263
Integers will be scaled to [-1, 1] in float32.
264264
"""
265265
float32_samples = samples.astype('float32')
266-
if samples.dtype in (np.int8, np.int16, np.int32, np.int64):
266+
if np.issubdtype(samples.dtype, np.integer):
267267
bits = np.iinfo(samples.dtype).bits
268268
float32_samples *= 1.0 / 2 ** (bits - 1)
269-
elif samples.dtype in (np.float16, np.float32, np.float64):
269+
elif np.issubdtype(samples.dtype, np.floating):
270270
pass
271271
else:
272272
raise TypeError("Unsupported sample type: %s." % samples.dtype)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
num2words
2-
numpy<2.0.0
2+
numpy>=1.22

0 commit comments

Comments
 (0)