Added metadata log functionality to build_model