MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / get_args

Function get_args

diffusers/scripts/convert_cogvideox_to_diffusers.py:190–218  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

188
189
190def get_args():
191 parser = argparse.ArgumentParser()
192 parser.add_argument(
193 "--transformer_ckpt_path", type=str, default=None, help="Path to original transformer checkpoint"
194 )
195 parser.add_argument("--vae_ckpt_path", type=str, default=None, help="Path to original vae checkpoint")
196 parser.add_argument("--output_path", type=str, required=True, help="Path where converted model should be saved")
197 parser.add_argument("--fp16", action="store_true", default=False, help="Whether to save the model weights in fp16")
198 parser.add_argument("--bf16", action="store_true", default=False, help="Whether to save the model weights in bf16")
199 parser.add_argument(
200 "--push_to_hub", action="store_true", default=False, help="Whether to push to HF Hub after saving"
201 )
202 parser.add_argument(
203 "--text_encoder_cache_dir", type=str, default=None, help="Path to text encoder cache directory"
204 )
205 # For CogVideoX-2B, num_layers is 30. For 5B, it is 42
206 parser.add_argument("--num_layers", type=int, default=30, help="Number of transformer blocks")
207 # For CogVideoX-2B, num_attention_heads is 30. For 5B, it is 48
208 parser.add_argument("--num_attention_heads", type=int, default=30, help="Number of attention heads")
209 # For CogVideoX-2B, use_rotary_positional_embeddings is False. For 5B, it is True
210 parser.add_argument(
211 "--use_rotary_positional_embeddings", action="store_true", default=False, help="Whether to use RoPE or not"
212 )
213 # For CogVideoX-2B, scaling_factor is 1.15258426. For 5B, it is 0.7
214 parser.add_argument("--scaling_factor", type=float, default=1.15258426, help="Scaling factor in the VAE")
215 # For CogVideoX-2B, snr_shift_scale is 3.0. For 5B, it is 1.0
216 parser.add_argument("--snr_shift_scale", type=float, default=3.0, help="Scaling factor in the VAE")
217 parser.add_argument("--i2v", action="store_true", default=False, help="Whether to save the model weights in fp16")
218 return parser.parse_args()
219
220
221if __name__ == "__main__":

Calls

no outgoing calls

Tested by

no test coverage detected