fastinom commited on
Commit
9f6521d
1 Parent(s): d9940ae

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -4
README.md CHANGED
@@ -76,19 +76,19 @@ Use the code below to get started with the model.
76
  from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
77
  import torch
78
  import torchaudio
79
- ```python
80
  model_id = "fastinom/ASR_fassy"
81
  model = Wav2Vec2ForCTC.from_pretrained(model_id)
82
  processor = Wav2Vec2Processor.from_pretrained(model_id)
83
- ```python
84
  def load_audio(file_path):
85
  speech_array, sampling_rate = torchaudio.load(file_path)
86
  resampler = torchaudio.transforms.Resample(sampling_rate, 16000)
87
  speech = resampler(speech_array).squeeze().numpy()
88
  return speech
89
- audio_file = "/content/drive/MyDrive/recordings/wavefiles/1.wa"#YOUR AUDIO PATH
90
  speech = load_audio(audio_file)
91
- ```python
92
  inputs = processor(speech, sampling_rate=16000, return_tensors="pt", padding=True)
93
  with torch.no_grad():
94
  logits = model(inputs.input_values).logits
 
76
  from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
77
  import torch
78
  import torchaudio
79
+
80
  model_id = "fastinom/ASR_fassy"
81
  model = Wav2Vec2ForCTC.from_pretrained(model_id)
82
  processor = Wav2Vec2Processor.from_pretrained(model_id)
83
+
84
  def load_audio(file_path):
85
  speech_array, sampling_rate = torchaudio.load(file_path)
86
  resampler = torchaudio.transforms.Resample(sampling_rate, 16000)
87
  speech = resampler(speech_array).squeeze().numpy()
88
  return speech
89
+ audio_file = "/content/drive/MyDrive/recordings/wavefiles/1.wav"
90
  speech = load_audio(audio_file)
91
+
92
  inputs = processor(speech, sampling_rate=16000, return_tensors="pt", padding=True)
93
  with torch.no_grad():
94
  logits = model(inputs.input_values).logits