Adapt training foreground script for models change