Added a possibility to configure get_model_fn