Update README.md
Browse files
README.md
CHANGED
|
@@ -137,6 +137,27 @@ print(result)
|
|
| 137 |
+ return_unique_speaker=False
|
| 138 |
```
|
| 139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
|
| 141 |
### Flash Attention 2
|
| 142 |
We recommend using [Flash-Attention 2](https://huggingface.co/docs/transformers/main/en/perf_infer_gpu_one#flashattention-2)
|
|
|
|
| 137 |
+ return_unique_speaker=False
|
| 138 |
```
|
| 139 |
|
| 140 |
+
- To contorol the number of speakers (see [here](https://huggingface.co/pyannote/speaker-diarization-3.1#controlling-the-number-of-speakers)):
|
| 141 |
+
```diff
|
| 142 |
+
result = pipe(
|
| 143 |
+
"sample_diarization_japanese.mp3",
|
| 144 |
+
+ num_speakers=2,
|
| 145 |
+
add_punctuation=False,
|
| 146 |
+
return_unique_speaker=True,
|
| 147 |
+
generate_kwargs=generate_kwargs
|
| 148 |
+
)
|
| 149 |
+
```
|
| 150 |
+
or
|
| 151 |
+
```diff
|
| 152 |
+
result = pipe(
|
| 153 |
+
"sample_diarization_japanese.mp3",
|
| 154 |
+
+ min_speakers=2,
|
| 155 |
+
+ max_speakers=5,
|
| 156 |
+
add_punctuation=False,
|
| 157 |
+
return_unique_speaker=True,
|
| 158 |
+
generate_kwargs=generate_kwargs
|
| 159 |
+
)
|
| 160 |
+
```
|
| 161 |
|
| 162 |
### Flash Attention 2
|
| 163 |
We recommend using [Flash-Attention 2](https://huggingface.co/docs/transformers/main/en/perf_infer_gpu_one#flashattention-2)
|