Upload wav2vec_stt.py
Browse files- wav2vec_stt.py +7 -0
wav2vec_stt.py
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
model="../wav2vec"
|
| 4 |
+
pipe = pipeline("automatic-speech-recognition", model=model)
|
| 5 |
+
audio_file = sys.argv[1]
|
| 6 |
+
result = pipe(audio_file)["text"]
|
| 7 |
+
print(result)
|