code: def mel2wave(
      mel,
      config_file="assets/hifigan/config.json",
      ckpt_file=FLAGS.ckpt_dir / "hk_hifi.pickle",
  ):
      with open(config_file) as f:
          data = f.read()
      json_config = json.loads(data)
      h = AttrDict(json_config)
  
      @hk.transform_with_state
      def forward(x):
          net = Generator(h)
          return net(x)
  
      rng = next(hk.PRNGSequence(42))
  
      with open(ckpt_file, "rb") as f:
          params = pickle.load(f)
      aux = {}
      wav, aux = forward.apply(params, aux, rng, mel)
      wav = jnp.squeeze(wav)
      audio = jax.device_get(wav)
      return audio
  
file_path: underthesea/underthesea/pipeline/say/viettts_/hifigan/mel2wave.py
imports: import json
  import pickle
  import haiku
  import jax
  import jax.numpy
  from .config import FLAGS
  from .model import Generator
label_desc: Use image node_id 1 for calling a global function with example usage: mel2wave(mel, config_file, ckpt_file) and returns: audio, net