Image-to-Text
Diffusers
Safetensors
English
uniar
image-generation
image-understanding
image-editing
multimodal
autoregressive
text-to-image
unified-model
Instructions to use ShareLab-SII/UniAR-RL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ShareLab-SII/UniAR-RL with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("ShareLab-SII/UniAR-RL", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
| { | |
| "architectures": [ | |
| "UniARForConditionalGeneration" | |
| ], | |
| "model_type": "uniar", | |
| "text_config": { | |
| "vocab_size": 151936, | |
| "hidden_size": 4096, | |
| "intermediate_size": 12288, | |
| "num_hidden_layers": 36, | |
| "num_attention_heads": 32, | |
| "num_key_value_heads": 8, | |
| "head_dim": 128, | |
| "hidden_act": "silu", | |
| "max_position_embeddings": 32768, | |
| "initializer_range": 0.02, | |
| "rms_norm_eps": 1e-06, | |
| "use_cache": true, | |
| "rope_theta": 1000000, | |
| "rope_scaling": { | |
| "mrope_section": [ | |
| 24, | |
| 20, | |
| 20 | |
| ], | |
| "rope_type": "default" | |
| }, | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "tie_word_embeddings": false | |
| }, | |
| "vision_config": { | |
| "depth": 27, | |
| "hidden_size": 1152, | |
| "hidden_act": "gelu_pytorch_tanh", | |
| "intermediate_size": 4304, | |
| "num_heads": 16, | |
| "in_channels": 3, | |
| "patch_size": 16, | |
| "spatial_merge_size": 2, | |
| "temporal_patch_size": 2, | |
| "out_hidden_size": 4096, | |
| "initializer_range": 0.02, | |
| "use_bsq": true, | |
| "bsq_dim": 64, | |
| "bsq_hidden_dim": 8192, | |
| "bsq_skip_final_layernorm": true, | |
| "vistok_pred": false, | |
| "vistok_pred_layernorm": false, | |
| "vistok_pred_transformer_head": false, | |
| "num_position_embeddings": 2304, | |
| "deepstack_visual_indexes": [ | |
| 8, | |
| 16, | |
| 24 | |
| ] | |
| }, | |
| "vistok_pred": true, | |
| "vistok_pred_layernorm": true, | |
| "vistok_pred_use_mlp": false, | |
| "visual_transformer_decoder": true, | |
| "image_token_id": 151655, | |
| "video_token_id": 151656, | |
| "vision_start_token_id": 151652, | |
| "vision_end_token_id": 151653, | |
| "tie_word_embeddings": false, | |
| "torch_dtype": "bfloat16" | |
| } |