Spaces:
Sleeping
Sleeping
juliuserictuliao
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,11 @@ def asr_transcript(audio):
|
|
22 |
return ""
|
23 |
|
24 |
# Ensure audio is a 1D numpy array
|
25 |
-
|
|
|
|
|
|
|
|
|
26 |
|
27 |
# Process the audio
|
28 |
input_values = processor(audio, sampling_rate=16000, return_tensors="pt").input_values
|
|
|
22 |
return ""
|
23 |
|
24 |
# Ensure audio is a 1D numpy array
|
25 |
+
if isinstance(audio, list):
|
26 |
+
audio = np.array(audio)
|
27 |
+
|
28 |
+
if audio.ndim > 1:
|
29 |
+
audio = audio.flatten()
|
30 |
|
31 |
# Process the audio
|
32 |
input_values = processor(audio, sampling_rate=16000, return_tensors="pt").input_values
|