Spaces:
Sleeping
Sleeping
juliuserictuliao
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -21,6 +21,9 @@ def asr_transcript(audio):
|
|
21 |
if audio is None or len(audio) == 0:
|
22 |
return ""
|
23 |
|
|
|
|
|
|
|
24 |
# Process the audio
|
25 |
input_values = processor(audio, sampling_rate=16000, return_tensors="pt").input_values
|
26 |
# Get logits
|
|
|
21 |
if audio is None or len(audio) == 0:
|
22 |
return ""
|
23 |
|
24 |
+
# Ensure audio is a 1D numpy array
|
25 |
+
audio = np.asarray(audio).flatten()
|
26 |
+
|
27 |
# Process the audio
|
28 |
input_values = processor(audio, sampling_rate=16000, return_tensors="pt").input_values
|
29 |
# Get logits
|