(args)
| 124 | logging.info("Finished AutoEncoder Model conversion.\n") |
| 125 | |
| 126 | def export(args) -> None: |
| 127 | |
| 128 | torch.manual_seed(0) |
| 129 | device = torch.device("cpu") |
| 130 | |
| 131 | # Load the model configuration |
| 132 | logging.info("Loading the AudioGen Checkpoint...") |
| 133 | with open(args.model_config, encoding="utf-8") as f: |
| 134 | model_config = json.load(f) |
| 135 | model, model_config = load_model( |
| 136 | model_config, |
| 137 | args.ckpt_path, |
| 138 | pretrained_name=None, |
| 139 | device=device, |
| 140 | ) |
| 141 | logging.info("Model is loaded...") |
| 142 | |
| 143 | # --------- Conditioners Model --------- |
| 144 | export_conditioners(model, args.output_path) |
| 145 | |
| 146 | # --------- Dit Model ---------------- |
| 147 | export_dit(model, args.output_path) |
| 148 | |
| 149 | # --------- AutoEncoder Model --------- |
| 150 | export_autoencoder(model, args.output_path) |
| 151 | |
| 152 | def main(): |
| 153 | parser = argparse.ArgumentParser() |
no test coverage detected