gautamtata commited on
Commit
8d6b413
1 Parent(s): 986c602

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +3 -3
handler.py CHANGED
@@ -173,11 +173,11 @@ class EndpointHandler():
173
 
174
  # However, since this handler is not loading from a path (as it does in speech_file_to_array_fn),
175
  # we need to read and process the buffer similar to how speech_file_to_array_fn would
176
- waveform, sample_rate = torchaudio.load(audio_buffer)
177
- waveform = waveform.squeeze().numpy()
178
 
179
  # Call the predict function and return its results
180
- predictions = self.predict(waveform, sample_rate)
181
  return predictions
182
  else:
183
  return {"error": "Audio input is required."}
 
173
 
174
  # However, since this handler is not loading from a path (as it does in speech_file_to_array_fn),
175
  # we need to read and process the buffer similar to how speech_file_to_array_fn would
176
+ # waveform, sample_rate = torchaudio.load(audio_buffer)
177
+ # waveform = waveform.squeeze().numpy()
178
 
179
  # Call the predict function and return its results
180
+ predictions = self.predict(audio_buffer)
181
  return predictions
182
  else:
183
  return {"error": "Audio input is required."}