Instructions to use jxie/sma-image-pretrained with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jxie/sma-image-pretrained with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import SMAForSSL model = SMAForSSL.from_pretrained("jxie/sma-image-pretrained", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download config.json from jxie/sma-image-pretrained: direct link, hf CLI and curl.
- Browser
- Download file 2.82 kB
-
https://huggingface.co/jxie/sma-image-pretrained/resolve/main/config.json
- Command line
-
hf download hf://jxie/sma-image-pretrained/config.json
-
curl -L -o config.json https://huggingface.co/jxie/sma-image-pretrained/resolve/main/config.json
2.82 kB
| { | |
| "_name_or_path": null, | |
| "architectures": [ | |
| "SMAForSSL" | |
| ], | |
| "attention_dropout_prob": 0.0, | |
| "cross_attention_widening_factor": 1, | |
| "cross_eval_noising_args": null, | |
| "cross_train_noising_args": [ | |
| [ | |
| "RandomlySelectedCrossAttentionMasking", | |
| { | |
| "exclude_seen_reconstruction": true, | |
| "masking_ratio": 0.75, | |
| "num_per_query": 144, | |
| "select_initial_ratio": 1.0, | |
| "varying_length": false | |
| } | |
| ] | |
| ], | |
| "decoder_attention_channels": 768, | |
| "decoder_heads": 1, | |
| "decoder_latent_channels": 768, | |
| "decoder_type": "cross_attention", | |
| "dense_use_bias": true, | |
| "drop_path_rate": 0.0, | |
| "embedded_channels": 196, | |
| "encoder_cross_attention_channels": 196, | |
| "encoder_type": "cross_attention", | |
| "final_project": true, | |
| "hidden_act": "gelu", | |
| "hidden_dropout_prob": 0.0, | |
| "initializer_range": 0.02, | |
| "input_channels": 3, | |
| "input_type": "continuous", | |
| "latent_channels": 768, | |
| "layer_norm_eps": 1e-12, | |
| "layernorm_eps": 1e-12, | |
| "loss_fn": "mse", | |
| "max_position_embeddings": 36864, | |
| "model_type": "sma", | |
| "num_blocks": 1, | |
| "num_cross_attention_heads": 1, | |
| "num_discrete_tokens": 262, | |
| "num_latents": 512, | |
| "num_outputs": 1, | |
| "num_self_attends_per_block": 8, | |
| "num_self_attention_heads": 8, | |
| "output_channels": 262, | |
| "pe_initializer_range": 0.02, | |
| "post_decoder_layers": null, | |
| "project_after_concat": true, | |
| "qk_channels": null, | |
| "self_attention_widening_factor": 4, | |
| "share_decoder_queries": true, | |
| "share_embedding_weights": true, | |
| "teacher_args": { | |
| "auxiliary_loss_fn": "mse", | |
| "auxiliary_loss_weight": 1.0, | |
| "ema_args": { | |
| "ema_decay_end": 0.0, | |
| "ema_decay_start": 0.0 | |
| }, | |
| "eval_transform_args": [ | |
| [ | |
| "RandomlySelectedCrossAttentionMasking", | |
| { | |
| "exclude_seen_reconstruction": true, | |
| "masking_ratio": 0.75, | |
| "num_per_query": 144, | |
| "select_initial_ratio": 1.0, | |
| "varying_length": false | |
| } | |
| ] | |
| ], | |
| "mask_replace": null, | |
| "norm_targets": true, | |
| "num_layer_target_avg": null, | |
| "reconstruction_decoder_args": { | |
| "num_heads": 1, | |
| "num_outputs": 36864, | |
| "output_channels": 3, | |
| "qk_channels": 196, | |
| "query_num_channels": 196, | |
| "share_decoder_queries": true, | |
| "share_embedding_weights": true, | |
| "use_query_residual": true, | |
| "v_channels": 196 | |
| }, | |
| "reconstruction_loss_fn": "mse", | |
| "reconstruction_loss_weight": 1.0, | |
| "reconstruction_weighted_loss": false, | |
| "target_normalization_fn": "layernorm", | |
| "train_transform_args": null | |
| }, | |
| "teacher_name": "ReconstructionTeacher", | |
| "torch_dtype": "float32", | |
| "transformers_version": "4.26.0.dev0", | |
| "use_decoder": false, | |
| "use_position_embeddings": true, | |
| "use_query_residual": true, | |
| "v_channels": 768 | |
| } | |