The VGG class is actually a wrapper around the keras model.
You are looking at the implementation to model.fit
The VGG.fit method actually uses the model.fit_generator which expects a generator instead, without a requirement for X, Y labels.
that’s because the generator itself knows the labels - the notebook shows this when calling next on the batch which returns a tuple of (img,label)
Just to add - if you were to use model.fit supplying X and Y, that would not be efficient for large data sets.
Python generators provide an efficient way of iterating over large data “lazily”.