Spaces:
Runtime error
Runtime error
Create app.txt
Browse files
app.txt
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torchaudio
|
2 |
+
import librosa
|
3 |
+
from transformers import Wav2Vec2ForCTC,Wav2Vec2Processor,pipeline
|
4 |
+
processor = Wav2Vec2Processor.from_pretrained(model_name_or_path)
|
5 |
+
model = Wav2Vec2ForCTC.from_pretrained("m3hrdadfi/wav2vec2-large-xlsr-persian")
|
6 |
+
def ASR(Audio):
|
7 |
+
audiofile=torchaudio.load(Audio,16000)
|
8 |
+
|
9 |
+
iface = gr.Interface(fn=ASR, inputs="audio", outputs="text")
|
10 |
+
iface.launch(share=False)
|