code: def get_model_arch(config):
      if "KerasModel" in config:
          # Model instance passed in config from API
          keras_model = config["KerasModel"]
          if isinstance(keras_model, str):
              from tensorflow.keras.models import load_model
  
              keras_model = load_model(keras_model)
          model_arch = json.loads(keras_model.to_json())
          reader = KerasModelReader(keras_model)
      elif "KerasJson" in config:
          # Extract model architecture from json
          with open(config["KerasJson"]) as json_file:
              model_arch = json.load(json_file)
          reader = KerasFileReader(config)
      elif "KerasH5" in config:
          # Model arch and weights are in H5 file (from model.save() function)
          with h5py.File(config["KerasH5"], mode="r") as h5file:
              # Load the configuration from h5 using json's decode
              model_arch = h5file.attrs.get("model_config")
              if model_arch is None:
                  raise ValueError("No model found in config file.")
              else:
                  # model_arch is string by default since h5py 3.0.0, keeping this condition for compatibility.
                  if isinstance(model_arch, bytes):
                      model_arch = model_arch.decode("utf-8")
                  model_arch = json.loads(model_arch)
          reader = KerasFileReader(config)
      else:
          raise ValueError("No model found in config file.")
  
      return model_arch, reader
  
imports: import json
  import h5py
  from hls4ml.model import ModelGraph
label_desc: Use image node_id 6 for calling a global function with example usage: get_model_arch(config) and returns: model_arch,  reader