()
| 203 | |
| 204 | # Function to parse command-line arguments for the script |
| 205 | def get_args(): |
| 206 | parser = argparse.ArgumentParser() |
| 207 | parser.add_argument( |
| 208 | "--transformer_ckpt_path", type=str, default=None, help="Path to original transformer checkpoint" |
| 209 | ) |
| 210 | parser.add_argument("--vae_ckpt_path", type=str, default=None, help="Path to original vae checkpoint") |
| 211 | parser.add_argument("--output_path", type=str, required=True, help="Path where converted model should be saved") |
| 212 | parser.add_argument( |
| 213 | "--text_encoder_path", |
| 214 | type=str, |
| 215 | required=True, |
| 216 | default="google/t5-v1_1-xxl", |
| 217 | help="Path where converted model should be saved", |
| 218 | ) |
| 219 | parser.add_argument( |
| 220 | "--text_encoder_cache_dir", |
| 221 | type=str, |
| 222 | default=None, |
| 223 | help="Path to text encoder cache directory. Not needed if text_encoder_path is in your local.", |
| 224 | ) |
| 225 | parser.add_argument("--fp16", action="store_true", default=True, help="Whether to save the model weights in fp16") |
| 226 | parser.add_argument( |
| 227 | "--push_to_hub", action="store_true", default=False, help="Whether to push to HF Hub after saving" |
| 228 | ) |
| 229 | return parser.parse_args() |
| 230 | |
| 231 | |
| 232 | if __name__ == "__main__": |
no outgoing calls
no test coverage detected