Getting error while writing the model function, how to fix this

(Solution code removed by staff)

Hi @ratnesh, welcome to Discourse! I am not sure whether somebody already responded to your post and whether you managed to solve your problem. Please note that it is policy not to publish any code-snipits on the platform, so could you please remove it? If you still have not solved your error: there is a type in one of the input parameters of your optimize function call.