Merge branch 'main' of https://huggingface.co/osanseviero/asr-with-transformers-wav2vec2 into main
Browse files- README.md +3 -0
- model.py +0 -6
- requirements.txt +2 -1
README.md
CHANGED
@@ -1,10 +1,13 @@
|
|
1 |
---
|
|
|
|
|
2 |
language: en
|
3 |
datasets:
|
4 |
- librispeech_asr
|
5 |
tags:
|
6 |
- audio
|
7 |
- automatic-speech-recognition
|
|
|
8 |
license: apache-2.0
|
9 |
widget:
|
10 |
- label: Librispeech sample 1
|
|
|
1 |
---
|
2 |
+
benchmark: superb
|
3 |
+
library_name: superb
|
4 |
language: en
|
5 |
datasets:
|
6 |
- librispeech_asr
|
7 |
tags:
|
8 |
- audio
|
9 |
- automatic-speech-recognition
|
10 |
+
- superb
|
11 |
license: apache-2.0
|
12 |
widget:
|
13 |
- label: Librispeech sample 1
|
model.py
CHANGED
@@ -3,7 +3,6 @@ from transformers import AutomaticSpeechRecognitionPipeline, AutoTokenizer, Wav2
|
|
3 |
from typing import Dict
|
4 |
from pathlib import Path
|
5 |
|
6 |
-
|
7 |
class PreTrainedModel():
|
8 |
def __init__(self):
|
9 |
"""
|
@@ -26,17 +25,12 @@ class PreTrainedModel():
|
|
26 |
"""
|
27 |
return self.model(inputs)
|
28 |
|
29 |
-
|
30 |
"""
|
31 |
# Just an example using this.
|
32 |
import subprocess
|
33 |
from datasets import load_dataset
|
34 |
|
35 |
def ffmpeg_read(bpayload: bytes, sampling_rate: int) -> np.array:
|
36 |
-
"""
|
37 |
-
Librosa does that under the hood but forces the use of an actual
|
38 |
-
file leading to hitting disk, which is almost always very bad.
|
39 |
-
"""
|
40 |
ar = f"{sampling_rate}"
|
41 |
ac = "1"
|
42 |
format_for_conversion = "f32le"
|
|
|
3 |
from typing import Dict
|
4 |
from pathlib import Path
|
5 |
|
|
|
6 |
class PreTrainedModel():
|
7 |
def __init__(self):
|
8 |
"""
|
|
|
25 |
"""
|
26 |
return self.model(inputs)
|
27 |
|
|
|
28 |
"""
|
29 |
# Just an example using this.
|
30 |
import subprocess
|
31 |
from datasets import load_dataset
|
32 |
|
33 |
def ffmpeg_read(bpayload: bytes, sampling_rate: int) -> np.array:
|
|
|
|
|
|
|
|
|
34 |
ar = f"{sampling_rate}"
|
35 |
ac = "1"
|
36 |
format_for_conversion = "f32le"
|
requirements.txt
CHANGED
@@ -1,2 +1,3 @@
|
|
1 |
transformers
|
2 |
-
numpy
|
|
|
|
1 |
transformers
|
2 |
+
numpy
|
3 |
+
torch
|