tfma.model_util.get_model_type

Returns model type for given model spec taking into account defaults.

The defaults are chosen such that if a model_path is provided and the model can be loaded as a keras model then TF_KERAS is assumed. Next, if tags are provided and the tags contains 'eval' then TF_ESTIMATOR is assumed. Lastly, if the model spec contains an 'eval' signature TF_ESTIMATOR is assumed otherwise TF_GENERIC is assumed.

model_spec Model spec.
model_path Optional model path to verify if keras model.
tags Options tags to verify if eval is used.