Question about model training

I have follow above link to do a model training but there is no model_final.pth shown after i trained. But if i follow the youtube link inside the blog, then it can show model_final.pth.
The difference is using patience during the training process.
So,i want to ask how to produce model_final.pth using the first method which is have patience for the iterations. Below is the link for the example code