SeyedAli commited on
Commit
5759877
1 Parent(s): 17eaac6

Create app.txt

Browse files
Files changed (1) hide show
  1. app.txt +10 -0
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)