code: def on_epoch_end(self, epoch, logs={}):
      if len(self.textgenrnn.model.inputs) > 1:
          self.textgenrnn.model = Model(
              inputs=self.model.input[0], outputs=self.model.output[1]
          )
      if (
          self.save_epochs > 0
          and (epoch + 1) % self.save_epochs == 0
          and self.num_epochs != (epoch + 1)
      ):
          print("Saving Model Weights — Epoch #{}".format(epoch + 1))
          self.textgenrnn.model.save_weights(
              "{}_weights_epoch_{}.hdf5".format(
                  self.weights_name, epoch + 1
              )
          )
      else:
          self.textgenrnn.model.save_weights(
              "{}_weights.hdf5".format(self.weights_name)
          )
  
imports: import csv
  import re
  from random import shuffle
  import numpy
  from tensorflow.keras import backend
  from tensorflow.keras.callbacks import Callback
  from tensorflow.keras.models import Model
  from tensorflow.keras.preprocessing import sequence
  from tqdm import trange
label_desc: Use image node_id 2 for calling the save_model_weights obj's underlying member method code with example usage: obj.on_epoch_end(epoch, logs) without return types