How can I specify a constant in an ensemble model? #6146
-
I have model A that resamples audio. It takes as input the audio, the input sample rate, and the output sample rate. And I have model B that takes 16kHz audio and produces some features. I want to make an ensemble model that first resamples audio to 16kHz and then extracts features. But I don't understand how to specify the needed sample rate (16kHz) in the model config. (A hack to work around this could be to just require the client to always specify this as an additional input to the ensemble model, but it doesn't really make sense to allow the client to specify this since there is only one value that will work.) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Is there a way for your model itself to do this logic? An ensemble is just a pipeline of models. If you know the value will always be 16, you can just build that into the model. If you mean that you would like to set a value (that is not always the same) one time at model load time based on the config, you could do that with a custom backend or use the Python backend. You can see how to get a model configuration parameter in your model here. |
Beta Was this translation helpful? Give feedback.
Is there a way for your model itself to do this logic? An ensemble is just a pipeline of models. If you know the value will always be 16, you can just build that into the model.
If you mean that you would like to set a value (that is not always the same) one time at model load time based on the config, you could do that with a custom backend or use the Python backend. You can see how to get a model configuration parameter in your model here.