Could you repost the formatted code by wrapping it into three backticks ``` or by clicking on the “Preformatted text” button in the text window?
The current code is quite hard to read and also doesn’t seem to show the actual model.train() call.