Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
7 |
|
8 |
# Load Whisper model
|
9 |
@st.cache_resource
|
10 |
def load_model():
|
11 |
-
return pipeline("automatic-speech-recognition", model="openai/whisper-
|
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 =
|
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:
|