(model_path, output_path)
| 73 | |
| 74 | |
| 75 | def main(model_path, output_path): |
| 76 | # Load your original U-Net model |
| 77 | unet_state_dict = load_file(model_path) |
| 78 | |
| 79 | # Initialize your Kandinsky3UNet model |
| 80 | config = {} |
| 81 | |
| 82 | # Convert the state dict |
| 83 | converted_state_dict = convert_state_dict(unet_state_dict) |
| 84 | |
| 85 | unet = Kandinsky3UNet(config) |
| 86 | unet.load_state_dict(converted_state_dict) |
| 87 | |
| 88 | unet.save_pretrained(output_path) |
| 89 | print(f"Converted model saved to {output_path}") |
| 90 | |
| 91 | |
| 92 | if __name__ == "__main__": |
no test coverage detected