roman commited on
Commit
8dd0371
1 Parent(s): c1dd4e9

add ability to chose a model

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -3,13 +3,20 @@ import whisper
3
  import tempfile
4
  from pydub import AudioSegment
5
 
6
- # Load the Whisper model
7
- model = whisper.load_model("base")
8
 
9
- st.title("Voice Recognition App using Whisper")
10
 
11
- st.write("Upload an audio file and the Whisper model will transcribe it to text.")
12
 
 
 
 
 
 
 
 
13
  # File uploader for audio file
14
  uploaded_file = st.file_uploader("Choose an audio file", type=["wav", "mp3", "m4a"])
15
 
 
3
  import tempfile
4
  from pydub import AudioSegment
5
 
6
+ # Define available models
7
+ available_models = ["tiny", "base", "small", "medium", "large"]
8
 
9
+ st.title("Voice Recognition App")
10
 
11
+ st.write("Upload an audio file and choose a Whisper model to transcribe it to text.")
12
 
13
+ # Model selection dropdown
14
+ model_choice = st.selectbox("Choose a Whisper model", available_models)
15
+
16
+ # Load the selected Whisper model
17
+ st.write(f"Loading {model_choice} model...")
18
+ model = whisper.load_model(model_choice)
19
+ st.write(f"{model_choice} model loaded successfully.")
20
  # File uploader for audio file
21
  uploaded_file = st.file_uploader("Choose an audio file", type=["wav", "mp3", "m4a"])
22