yavuzkomecoglu commited on
Commit
3268a18
1 Parent(s): fec8137

update model

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. utils.py +2 -2
app.py CHANGED
@@ -22,7 +22,7 @@ inputs = gr.inputs.Audio(label="Input Audio", type="file")
22
  outputs = "text"
23
  title = "Turkish Automatic Speech Recognition"
24
  description = "Demo for Turkish Automatic Speech Recognition with Huggingface wav2vec Turkish Model. To use it, simply upload your audio, or click one of the examples to load them."
25
- article = "<p style='text-align: center'>This is the model for <a href='https://huggingface.co/patrickvonplaten/wav2vec2-common_voice-tr-demo-dist' target='_blank'>patrickvonplaten/wav2vec2-common_voice-tr-demo-dist</a>, a fine-tuned <a href='https://huggingface.co/facebook/wav2vec2-large-xlsr-53' target='_blank'>facebook/wav2vec2-large-xlsr-53</a> model on the <a href='https://commonvoice.mozilla.org/en/datasets' target='_blank'>Turkish Common Voice dataset</a>.<br/>When using this model, make sure that your speech input is sampled at 16kHz.<br/><a href='https://github.com/yavuzKomecoglu' target='_blank'>Contact me</a></p>"
26
  examples = [
27
  ['assets/samples/common_voice_sample_1378.flac'],
28
  ['assets/samples/common_voice_sample_1589.flac'],
22
  outputs = "text"
23
  title = "Turkish Automatic Speech Recognition"
24
  description = "Demo for Turkish Automatic Speech Recognition with Huggingface wav2vec Turkish Model. To use it, simply upload your audio, or click one of the examples to load them."
25
+ article = "<p style='text-align: center'>This is the model for <a href='https://huggingface.co/patrickvonplaten/wav2vec2-common_voice-tr-demo' target='_blank'>patrickvonplaten/wav2vec2-common_voice-tr-demo</a>, a fine-tuned <a href='https://huggingface.co/facebook/wav2vec2-large-xlsr-53' target='_blank'>facebook/wav2vec2-large-xlsr-53</a> model on the <a href='https://commonvoice.mozilla.org/en/datasets' target='_blank'>Turkish Common Voice dataset</a>.<br/>When using this model, make sure that your speech input is sampled at 16kHz.<br/><a href='https://github.com/yavuzKomecoglu' target='_blank'>Contact me</a></p>"
26
  examples = [
27
  ['assets/samples/common_voice_sample_1378.flac'],
28
  ['assets/samples/common_voice_sample_1589.flac'],
utils.py CHANGED
@@ -28,8 +28,8 @@ class SpeechRecognition:
28
  self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
29
  #self.processor = Wav2Vec2Processor.from_pretrained("m3hrdadfi/wav2vec2-large-xlsr-turkish")
30
  #self.model = Wav2Vec2ForCTC.from_pretrained("m3hrdadfi/wav2vec2-large-xlsr-turkish").to(self.device)
31
- self.processor = AutoTokenizer.from_pretrained("patrickvonplaten/wav2vec2-common_voice-tr-demo-dist")
32
- self.model = Wav2Vec2ForCTC.from_pretrained("patrickvonplaten/wav2vec2-common_voice-tr-demo-dist").to(self.device)
33
 
34
  return self
35
 
28
  self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
29
  #self.processor = Wav2Vec2Processor.from_pretrained("m3hrdadfi/wav2vec2-large-xlsr-turkish")
30
  #self.model = Wav2Vec2ForCTC.from_pretrained("m3hrdadfi/wav2vec2-large-xlsr-turkish").to(self.device)
31
+ self.processor = Wav2Vec2Processor.from_pretrained("patrickvonplaten/wav2vec2-common_voice-tr-demo")
32
+ self.model = Wav2Vec2ForCTC.from_pretrained("patrickvonplaten/wav2vec2-common_voice-tr-demo").to(self.device)
33
 
34
  return self
35