Image-Text-to-Text
Transformers
Safetensors
modilify_mk1
text-generation
diffusion
multimodal
mixture-of-experts
trust-remote-code
conversational
custom_code
Instructions to use modilify/Modilify-Mk1-preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use modilify/Modilify-Mk1-preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="modilify/Modilify-Mk1-preview", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("modilify/Modilify-Mk1-preview", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use modilify/Modilify-Mk1-preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "modilify/Modilify-Mk1-preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "modilify/Modilify-Mk1-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/modilify/Modilify-Mk1-preview
- SGLang
How to use modilify/Modilify-Mk1-preview with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "modilify/Modilify-Mk1-preview" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "modilify/Modilify-Mk1-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "modilify/Modilify-Mk1-preview" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "modilify/Modilify-Mk1-preview", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use modilify/Modilify-Mk1-preview with Docker Model Runner:
docker model run hf.co/modilify/Modilify-Mk1-preview
| { | |
| "architectures": [ | |
| "ModilifyMk1ForBlockDiffusion" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_modilify_mk1.ModilifyMk1Config", | |
| "AutoModel": "modeling_modilify_mk1.ModilifyMk1Model", | |
| "AutoModelForCausalLM": "modeling_modilify_mk1.ModilifyMk1ForBlockDiffusion", | |
| "AutoModelForMultimodalLM": "modeling_modilify_mk1.ModilifyMk1ForBlockDiffusion" | |
| }, | |
| "boi_token_id": 255999, | |
| "bos_token_id": 2, | |
| "canvas_length": 256, | |
| "commit_failure_budget": 0.2, | |
| "denoise_temperature": 0.8, | |
| "dtype": "bfloat16", | |
| "eoi_token_id": 258882, | |
| "eos_token_id": [ | |
| 1, | |
| 106 | |
| ], | |
| "fused_entropy_weight": 0.5, | |
| "image_token_id": 258880, | |
| "initializer_range": 0.02, | |
| "jump_failure_budget": 2.0, | |
| "jump_on_no_progress_after": 12, | |
| "latent_dim": 1536, | |
| "latent_dropout": 0.0, | |
| "latent_local_attention_window": 128, | |
| "latent_memory_slots": 64, | |
| "latent_num_heads": 16, | |
| "latent_num_layers": 4, | |
| "max_ponder_steps": 64, | |
| "min_trajectory_progress": 0.005, | |
| "model_type": "modilify_mk1", | |
| "pad_token_id": 0, | |
| "text_config": { | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "bos_token_id": 2, | |
| "dtype": "bfloat16", | |
| "eos_token_id": 1, | |
| "final_logit_softcapping": 30.0, | |
| "global_head_dim": 512, | |
| "head_dim": 256, | |
| "hidden_activation": "gelu_pytorch_tanh", | |
| "hidden_size": 2816, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 2112, | |
| "layer_types": [ | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention" | |
| ], | |
| "max_position_embeddings": 262144, | |
| "model_type": "modilify_mk1_text", | |
| "moe_intermediate_size": 704, | |
| "num_attention_heads": 16, | |
| "num_experts": 128, | |
| "num_global_key_value_heads": 2, | |
| "num_hidden_layers": 30, | |
| "num_key_value_heads": 8, | |
| "pad_token_id": 0, | |
| "rms_norm_eps": 1e-06, | |
| "rope_parameters": { | |
| "full_attention": { | |
| "partial_rotary_factor": 0.25, | |
| "rope_theta": 1000000.0, | |
| "rope_type": "proportional" | |
| }, | |
| "sliding_attention": { | |
| "rope_theta": 10000.0, | |
| "rope_type": "default" | |
| } | |
| }, | |
| "sliding_window": 1024, | |
| "tie_word_embeddings": true, | |
| "top_k_experts": 8, | |
| "use_bidirectional_attention": "vision", | |
| "vocab_size": 262144 | |
| }, | |
| "tie_word_embeddings": true, | |
| "transformers_version": "5.14.1", | |
| "turn_end_token_id": 106, | |
| "vision_config": { | |
| "_name_or_path": "", | |
| "architectures": null, | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "chunk_size_feed_forward": 0, | |
| "default_output_length": 280, | |
| "dtype": "bfloat16", | |
| "global_head_dim": 72, | |
| "head_dim": 72, | |
| "hidden_activation": "gelu_pytorch_tanh", | |
| "hidden_size": 1152, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1" | |
| }, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 4304, | |
| "is_encoder_decoder": false, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1 | |
| }, | |
| "max_position_embeddings": 131072, | |
| "model_type": "gemma4_vision", | |
| "num_attention_heads": 16, | |
| "num_hidden_layers": 27, | |
| "num_key_value_heads": 16, | |
| "output_attentions": false, | |
| "output_hidden_states": false, | |
| "patch_size": 16, | |
| "pooling_kernel_size": 3, | |
| "position_embedding_size": 10240, | |
| "problem_type": null, | |
| "return_dict": true, | |
| "rms_norm_eps": 1e-06, | |
| "rope_parameters": { | |
| "rope_theta": 100.0, | |
| "rope_type": "default" | |
| }, | |
| "standardize": true, | |
| "use_clipped_linears": false | |
| }, | |
| "vocab_chunk_size": 65536 | |
| } | |