Update README.md
Browse files
README.md
CHANGED
@@ -130,7 +130,10 @@ and two feedforward layers with 4 sigmoid outputs for each frame input at the to
|
|
130 |
## NVIDIA NeMo
|
131 |
|
132 |
To train, fine-tune or perform diarization with Sortformer, you will need to install [NVIDIA NeMo](https://github.com/NVIDIA/NeMo)[5]. We recommend you install it after you've installed Cython and latest PyTorch version.
|
|
|
133 |
```
|
|
|
|
|
134 |
pip install git+https://github.com/NVIDIA/NeMo.git@main#egg=nemo_toolkit[asr]
|
135 |
```
|
136 |
|
@@ -143,10 +146,14 @@ The model is available for use in the NeMo Framework[5], and can be used as a pr
|
|
143 |
```python
|
144 |
from nemo.collections.asr.models import SortformerEncLabelModel
|
145 |
|
146 |
-
# load model from a downloaded file
|
147 |
-
diar_model = SortformerEncLabelModel.restore_from(restore_path="/path/to/diar_sortformer_4spk-v1.nemo", map_location=torch.device('cuda'), strict=False)
|
148 |
# load model from Hugging Face model card directly (You need a Hugging Face token)
|
149 |
diar_model = SortformerEncLabelModel.from_pretrained("nvidia/diar_sortformer_4spk-v1")
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
# switch to inference mode
|
151 |
diar_model.eval()
|
152 |
```
|
|
|
130 |
## NVIDIA NeMo
|
131 |
|
132 |
To train, fine-tune or perform diarization with Sortformer, you will need to install [NVIDIA NeMo](https://github.com/NVIDIA/NeMo)[5]. We recommend you install it after you've installed Cython and latest PyTorch version.
|
133 |
+
|
134 |
```
|
135 |
+
apt-get update && apt-get install -y libsndfile1 ffmpeg
|
136 |
+
pip install Cython packaging
|
137 |
pip install git+https://github.com/NVIDIA/NeMo.git@main#egg=nemo_toolkit[asr]
|
138 |
```
|
139 |
|
|
|
146 |
```python
|
147 |
from nemo.collections.asr.models import SortformerEncLabelModel
|
148 |
|
|
|
|
|
149 |
# load model from Hugging Face model card directly (You need a Hugging Face token)
|
150 |
diar_model = SortformerEncLabelModel.from_pretrained("nvidia/diar_sortformer_4spk-v1")
|
151 |
+
|
152 |
+
# If you have a downloaded model in "/path/to/diar_sortformer_4spk-v1.nemo", load model from a downloaded file
|
153 |
+
import torch
|
154 |
+
diar_model = SortformerEncLabelModel.restore_from(restore_path="/path/to/diar_sortformer_4spk-v1.nemo", map_location=torch.device('cuda'), strict=False)
|
155 |
+
|
156 |
+
|
157 |
# switch to inference mode
|
158 |
diar_model.eval()
|
159 |
```
|