Commit
•
8b61d43
1
Parent(s):
d572bc2
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,25 @@
|
|
1 |
---
|
2 |
license: mit
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
---
|
4 |
+
|
5 |
+
The model was fine-tuned on 300h of public and private speech data. More information will be given once the underlying paper gets published.
|
6 |
+
|
7 |
+
```
|
8 |
+
import librosa
|
9 |
+
from transformers import Wav2Vec2Processor, AutoModelForCTC
|
10 |
+
import torch
|
11 |
+
|
12 |
+
audio, _ = librosa.load("[audio_path]", sr=16000)
|
13 |
+
model = AutoModelForCTC.from_pretrained("racai/wav2vec2-base-100k-voxpopuli-romanian")
|
14 |
+
processor = Wav2Vec2Processor.from_pretrained("racai/wav2vec2-base-100k-voxpopuli-romanian")
|
15 |
+
|
16 |
+
input_dict = processor(audio, sampling_rate=16000, return_tensors="pt")
|
17 |
+
|
18 |
+
with torch.inference_mode():
|
19 |
+
logits = model(input_dict.input_values).logits
|
20 |
+
|
21 |
+
predicted_ids = torch.argmax(logits, dim=-1)
|
22 |
+
predicted_sentence = processor.batch_decode(predicted_ids)[0]
|
23 |
+
|
24 |
+
print("Prediction:", predicted_sentence)
|
25 |
+
```
|