Fix example usage
#77
by
bezzam
HF Staff
- opened
README.md
CHANGED
|
@@ -171,10 +171,15 @@ pipe = pipeline(
|
|
| 171 |
dataset = load_dataset("distil-whisper/librispeech_long", "clean", split="validation")
|
| 172 |
sample = dataset[0]["audio"]
|
| 173 |
|
| 174 |
-
result = pipe(sample)
|
| 175 |
print(result["text"])
|
| 176 |
```
|
| 177 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
To transcribe a local audio file, simply pass the path to your audio file when you call the pipeline:
|
| 179 |
|
| 180 |
```python
|
|
|
|
| 171 |
dataset = load_dataset("distil-whisper/librispeech_long", "clean", split="validation")
|
| 172 |
sample = dataset[0]["audio"]
|
| 173 |
|
| 174 |
+
result = pipe(sample, return_timestamps=True)
|
| 175 |
print(result["text"])
|
| 176 |
```
|
| 177 |
|
| 178 |
+
It is also possible to transcribe a link to an audio file:
|
| 179 |
+
```python
|
| 180 |
+
result = pipe("https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac")
|
| 181 |
+
```
|
| 182 |
+
|
| 183 |
To transcribe a local audio file, simply pass the path to your audio file when you call the pipeline:
|
| 184 |
|
| 185 |
```python
|