-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Fix NumPy 2.0 compatibility: Replace np.sctypes with np.issubdtype #14762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
1e884f8 to
75bcd10
Compare
|
@titu1994 @redoctopus Could you review this NumPy 2.0 compatibility fix for ASR? |
|
It would be awesome if you could take a look at this @nithinraok |
| Integers will be scaled to [-1, 1] in float32. | ||
| """ | ||
| float32_samples = samples.astype('float32') | ||
| if samples.dtype in (np.int8, np.int16, np.int32, np.int64): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don;t see np.sctypes['int'] here?
also NeMo asr doesn;t enforce NeMo <2.0
see: https://github.com/NVIDIA-NeMo/NeMo/blob/main/requirements/requirements_asr.txt
https://github.com/NVIDIA-NeMo/NeMo/blob/main/requirements/requirements.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right there's no np.sctypes['int'] anywhere in NeMo
@conceptofmind do you think the error is from librosa or another dependency and could you post the full traceback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right there's no np.sctypes['int'] anywhere in NeMo
@conceptofmind do you think the error is from librosa or another dependency and could you post the full traceback
I am not sure why, then, but for others who may run into this.
When I do: uv add "nemo_toolkit[asr] --optional audio
I get:
And because nemo-toolkit[asr]==2.6.0rc0 depends on numpy<2.0.0 and only nemo-toolkit[asr]==2.6.0rc0 is available, we can conclude that jotunn[image] and all versions of nemo-toolkit[asr] are
incompatible.
And because your project depends on nemo-toolkit[asr] and your project requires jotunn[image], we can conclude that your project's requirements are unsatisfiable.
help: If you want to add the package regardless of the failed resolution, provide the `--frozen` flag to skip locking and syncing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also that sounds just like a chatgpt/claude response and I am pretty sure it is. "you're right"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't changing numpy<2.0.0 to numpy>=1.22 fix it then? and what do you mean a chatgpt/claude response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@conceptofmind i changed the numpy < 2.0 cap from tools/ctc_segmentation/requirements.txt. Could you try running "nemo_toolkit[asr] --optional audio" again against this branch
131ed30 to
2998d66
Compare
Signed-off-by: Abenezer <[email protected]>
2998d66 to
97a3846
Compare
Important
The
Update branchbutton must only be pressed in very rare occassions.An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.
What does this PR do ?
Removes NumPy 2.0 constraint from ctc_segmentation dependencies to allow NeMo ASR installation with NumPy 2.0+
Collection: ASR
Changelog
Testing
GitHub Actions CI
The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.
The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".
Before your PR is "Ready for review"
Pre checks:
PR Type:
If you haven't finished some of the above items you can still open "Draft" PR.
Who can review?
Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.
Additional Information
np.sctypeswas removed in the NumPy 2.0 release. Access dtypes explicitly instead. #14745