Spaces:
Runtime error
Runtime error
Copy Boss
commited on
Commit
•
332a470
1
Parent(s):
8f2192a
h3
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ from io import BytesIO
|
|
8 |
|
9 |
# Create a dropdown to select the model
|
10 |
model_options = ["base", "small", "medium", "large", "large-v2"]
|
11 |
-
default_model = "
|
12 |
model_name = st.selectbox("Select a model", options=model_options, index=model_options.index(default_model))
|
13 |
|
14 |
# Load the selected model
|
@@ -25,7 +25,7 @@ if st.button('Transcribe'):
|
|
25 |
# Resample the audio data if necessary
|
26 |
expected_sample_rate = 16000 # replace with the sample rate expected by the model
|
27 |
if sample_rate != expected_sample_rate:
|
28 |
-
audio_data = librosa.resample(audio_data, sample_rate, expected_sample_rate)
|
29 |
# Convert the audio data to float
|
30 |
audio_data = torch.from_numpy(audio_data).float()
|
31 |
# Transcribe the audio file
|
|
|
8 |
|
9 |
# Create a dropdown to select the model
|
10 |
model_options = ["base", "small", "medium", "large", "large-v2"]
|
11 |
+
default_model = "base"
|
12 |
model_name = st.selectbox("Select a model", options=model_options, index=model_options.index(default_model))
|
13 |
|
14 |
# Load the selected model
|
|
|
25 |
# Resample the audio data if necessary
|
26 |
expected_sample_rate = 16000 # replace with the sample rate expected by the model
|
27 |
if sample_rate != expected_sample_rate:
|
28 |
+
audio_data = librosa.resample(audio_data, orig_sr=sample_rate, target_sr=expected_sample_rate)
|
29 |
# Convert the audio data to float
|
30 |
audio_data = torch.from_numpy(audio_data).float()
|
31 |
# Transcribe the audio file
|