Tufan1 commited on
Commit
014aebe
·
verified ·
1 Parent(s): 2bcae86

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -6,7 +6,7 @@ from peft import PeftModel
6
  from pydub import AudioSegment
7
  import speech_recognition as sr
8
  import io
9
- from audiorecorder import audiorecorder # Add at the top with other imports
10
 
11
  # Load model and tokenizer from local fine-tuned directory
12
  # Define base and adapter model paths
@@ -134,7 +134,7 @@ elif input_mode == "Audio Upload":
134
  st.error(f"Audio processing error: {e}")
135
 
136
  elif audio_input_mode == "Record Audio":
137
- audio = audiorecorder("Click to record", "Recording...")
138
  if len(audio) > 0:
139
  st.audio(audio.tobytes(), format="audio/wav")
140
  wav_io = io.BytesIO(audio.tobytes())
 
6
  from pydub import AudioSegment
7
  import speech_recognition as sr
8
  import io
9
+ from audio_recorder_streamlit import audio_recorder # Add at the top with other imports
10
 
11
  # Load model and tokenizer from local fine-tuned directory
12
  # Define base and adapter model paths
 
134
  st.error(f"Audio processing error: {e}")
135
 
136
  elif audio_input_mode == "Record Audio":
137
+ audio = audio_recorder("Click to record", "Recording...")
138
  if len(audio) > 0:
139
  st.audio(audio.tobytes(), format="audio/wav")
140
  wav_io = io.BytesIO(audio.tobytes())