When you complete the definition of the model, you need to run the Check Model function to verify if there are errors or warnings in the model. If there are errors, you need to fix them before generating code.