pratikshahp commited on
Commit
a47b51d
·
verified ·
1 Parent(s): a480211

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -46,7 +46,6 @@
46
  # st.write("Error: Failed to transcribe audio.")
47
  #else:
48
  # st.write("No audio recorded.")
49
-
50
  import torch
51
  import streamlit as st
52
  from audio_recorder_streamlit import audio_recorder
@@ -54,8 +53,8 @@ import numpy as np
54
  from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq
55
 
56
  def transcribe_audio(audio_bytes):
57
- processor = AutoProcessor.from_pretrained('facebook/s2t-small-librispeech-asr')
58
- model = AutoModelForSpeechSeq2Seq.from_pretrained('facebook/s2t-small-librispeech-asr')
59
 
60
  # Convert audio bytes to numpy array
61
  audio_array = np.frombuffer(audio_bytes, dtype=np.int16)
 
46
  # st.write("Error: Failed to transcribe audio.")
47
  #else:
48
  # st.write("No audio recorded.")
 
49
  import torch
50
  import streamlit as st
51
  from audio_recorder_streamlit import audio_recorder
 
53
  from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq
54
 
55
  def transcribe_audio(audio_bytes):
56
+ processor = AutoProcessor.from_pretrained("facebook/s2t-small-librispeech-asr")
57
+ model = AutoModelForSpeechSeq2Seq.from_pretrained("facebook/s2t-small-librispeech-asr")
58
 
59
  # Convert audio bytes to numpy array
60
  audio_array = np.frombuffer(audio_bytes, dtype=np.int16)