Skip to content

Conversation

@Abenez3r
Copy link

@Abenez3r Abenez3r commented Sep 19, 2025

Important

The Update branch button 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

  • Remove numpy<2.0.0 constraint from tools/ctc_segmentation/requirements.txt
  • Update to numpy>=1.22 to allow NumPy 2.0+ while maintaining minimum version requirement
  • Resolves dependency conflict preventing NumPy 2.0 installation with nemo_toolkit[asr]

Testing

  • ASR model loading and transcription still work
  • ctc_segmentation 1.7.4 tested compatible with NumPy 2.0+

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:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

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

@github-actions github-actions bot added the ASR label Sep 19, 2025
@Abenez3r Abenez3r force-pushed the fix-numpy-2-compatibility branch from 1e884f8 to 75bcd10 Compare September 19, 2025 20:04
@Abenez3r
Copy link
Author

@titu1994 @redoctopus Could you review this NumPy 2.0 compatibility fix for ASR?

@conceptofmind
Copy link

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):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

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

Copy link

@conceptofmind conceptofmind Sep 22, 2025

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.

Copy link

@conceptofmind conceptofmind Sep 22, 2025

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"

Copy link
Author

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

Copy link
Author

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

@Abenez3r Abenez3r force-pushed the fix-numpy-2-compatibility branch 2 times, most recently from 131ed30 to 2998d66 Compare September 24, 2025 04:09
@github-actions github-actions bot removed the ASR label Sep 24, 2025
@Abenez3r Abenez3r force-pushed the fix-numpy-2-compatibility branch from 2998d66 to 97a3846 Compare September 24, 2025 04:27
@Abenez3r Abenez3r requested a review from nithinraok September 27, 2025 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nemo ASR: AttributeError: np.sctypes was removed in the NumPy 2.0 release. Access dtypes explicitly instead.

3 participants