wav2vec2-service
wav2vec2-service copied to clipboard
ONNXRuntimeError]
Hi , I have a problem with ONNXRuntime it shows me this error
[ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Got invalid dimensions for input: input for the following indices index: 0 Got: 196320 Expected: 1 Please fix either the inputs or the model.
this is the function
def predict(file):
speech_array, sr = sf.read(file)
features = processor(speech_array, sampling_rate=16000, return_tensors="pt")
input_values = features.input_values
print(input_values.numpy())
onnx_outputs = session.run(None, {session.get_inputs()[0].name: input_values.numpy()})[0]
prediction = np.argmax(onnx_outputs, axis=-1)
return processor.decode(prediction.squeeze().tolist())