juliuserictuliao commited on
Commit
11acde6
·
verified ·
1 Parent(s): 9e8f0e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
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