Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
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 =
|
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())
|