iisadia commited on
Commit
6dc3295
·
verified ·
1 Parent(s): e6530a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -3,12 +3,12 @@ from transformers import pipeline
3
  import numpy as np
4
  import soundfile as sf
5
  from io import BytesIO
6
- from stt_audiorec import stt_audiorec
7
 
8
  # Load Whisper model
9
  @st.cache_resource
10
  def load_model():
11
- return pipeline("automatic-speech-recognition", model="openai/whisper-small")
12
 
13
  st.title("Text Entry with Voice Input")
14
  st.write("Enter text manually or use voice input:")
@@ -25,9 +25,9 @@ with col1:
25
  text_input = st.text_area("Type your text here:", height=200)
26
 
27
  with col2:
28
- # Audio input
29
  st.write("Record your voice:")
30
- audio_bytes = stt_audiorec()
31
 
32
  # Process audio when recording is available
33
  if audio_bytes:
 
3
  import numpy as np
4
  import soundfile as sf
5
  from io import BytesIO
6
+ from audio_recorder_streamlit import audio_recorder
7
 
8
  # Load Whisper model
9
  @st.cache_resource
10
  def load_model():
11
+ return pipeline("automatic-speech-recognition", model="openai/whisper-base")
12
 
13
  st.title("Text Entry with Voice Input")
14
  st.write("Enter text manually or use voice input:")
 
25
  text_input = st.text_area("Type your text here:", height=200)
26
 
27
  with col2:
28
+ # Audio input using alternative recorder
29
  st.write("Record your voice:")
30
+ audio_bytes = audio_recorder()
31
 
32
  # Process audio when recording is available
33
  if audio_bytes: