Adds explicit requirements to ensure correct dependencies are installed
State: closed | Pull request: yes
Labels: name: stale

# What does this PR do ?

Numpy 1.x is required, but 2 (latest) will be installed if it is not present.  IPython is also required, but not listed as a requirement.  Explicit requirements also make it possible to use `pip install nemo_toolkit` without the entire Anaconda distribution installed.

This change is similar to #9805 , which upper-bounded `huggingface_hub`.

Also include a few trivial typos in the tutorial notebooks.

**Collection**: [Note which collection this PR will affect]

# Changelog 
- Add specific line by line info of high level changes in this PR.

# Usage
* You can potentially add a usage example below

```python
# Add a code snippet demonstrating how to use this 
```

# 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](https://github.com/NVIDIA/NeMo/blob/main/CONTRIBUTING.md)
- [ ] 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](https://github.com/NVIDIA/NeMo/blob/main/CONTRIBUTING.md) contains specific people who can review PRs to various areas.

# Additional Information
* Related to # (issue)


There was a another comment asking about the numpy < 2 requirement.  It's due to the use of `numpy.sctypes()` which has been removed from NumPy 2.  (As have the scalar type predicates, `issctype()` and `issubsctype()`.)

This occurs inside the ClusteringDiarizer:

```
  File "/code/nemo/t/lib/python3.10/site-packages/nemo/collections/asr/parts/preprocessing/segment.py", line 258, in _convert_samples_to_float32
    if samples.dtype in np.sctypes['int']:
  File "/code/nemo/t/lib/python3.10/site-packages/numpy/__init__.py", line 397, in __getattr__
    raise AttributeError(
AttributeError: `np.sctypes` was removed in the NumPy 2.0 release. Access dtypes explicitly instead.. Did you mean: 'dtypes'?
```

It does not appear to be used in many locations:

```
$ grep -r 'in .*\.sctypes' .
./nemo/collections/asr/parts/preprocessing/feature_loader.py:        if samples.dtype in np.sctypes['int']:
./nemo/collections/asr/parts/preprocessing/feature_loader.py:        elif samples.dtype in np.sctypes['float']:
./nemo/collections/asr/parts/preprocessing/segment.py:        if samples.dtype in np.sctypes['int']:
./nemo/collections/asr/parts/preprocessing/segment.py:        elif samples.dtype in np.sctypes['float']:
```

I experimented, and I believe this could be changed to use `issubdtype()` which is present in both NumPy 1.x and 2.  I could look more closely at NumPy 2 in another PR.  ~~It might be nice to start moving NeMo toward it, as it seems NumPy 2 has significant improvements.  LMK.~~

Aside from NeMo code, NumPy 2 will at least need Tensorboard >= 2.18, for its update to NumPy 2 ([done](https://github.com/tensorflow/tensorboard/commit/b163c5df852f08468013fb292bff854e5f49add0) but not released).

Thanks for the feedback on this PR!

This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days.

This PR was closed because it has been inactive for 7 days since being marked as stale.