Script to automate model generation