Different training method for encoder-decoder model
One is a straight forward use of API while the other one gives you much better control on training. If you are experimenting, it is good to go with a custom training loop so you can control the various things that happen to your model's training.
But, if you want to just train a model and not experiment with it much, save time and go for the straight forward method of training.
Both are same but one gives you much more control.