Text Generation
Transformers
Safetensors
modilify_mk2
diffusion
mixture-of-experts
trust-remote-code
conversational
custom_code
Instructions to use modilify/Modilify-Mk2-preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use modilify/Modilify-Mk2-preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="modilify/Modilify-Mk2-preview", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("modilify/Modilify-Mk2-preview", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use modilify/Modilify-Mk2-preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "modilify/Modilify-Mk2-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-Mk2-preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/modilify/Modilify-Mk2-preview
- SGLang
How to use modilify/Modilify-Mk2-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-Mk2-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-Mk2-preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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-Mk2-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-Mk2-preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use modilify/Modilify-Mk2-preview with Docker Model Runner:
docker model run hf.co/modilify/Modilify-Mk2-preview
Download config.json from modilify/Modilify-Mk2-preview: direct link, hf CLI and curl.
- Browser
- Download file 3.52 kB
-
https://huggingface.co/modilify/Modilify-Mk2-preview/resolve/main/config.json
- Command line
-
hf download hf://modilify/Modilify-Mk2-preview/config.json
-
curl -L -o config.json https://huggingface.co/modilify/Modilify-Mk2-preview/resolve/main/config.json
3.52 kB
| { | |
| "canvas_length": 256, | |
| "commit_confidence_power": 1.0, | |
| "commit_entropy_weight": 1.0, | |
| "commit_failure_budget": 0.2, | |
| "commit_min_p": 0.05, | |
| "commit_sequence_dim": 1024, | |
| "commit_target_confidence": 0.5, | |
| "commit_top_k": 40, | |
| "eos_token_id": 1, | |
| "initializer_range": 0.02, | |
| "kv_cache_bucket_size": 128, | |
| "latent_dim": 2816, | |
| "latent_ffn_dim": 7168, | |
| "latent_history_kv_rank": 1024, | |
| "latent_local_attention_window": 128, | |
| "latent_num_heads": 16, | |
| "latent_num_layers": 4, | |
| "latent_tape_probes": 4, | |
| "latent_working_last_block_global": true, | |
| "memory_architecture": "compact_gdn2_v2", | |
| "model_type": "modilify_mk2", | |
| "persistent_memory_bus": true, | |
| "state_schema_version": 25, | |
| "terminal_token_ids": [ | |
| 106, | |
| 50 | |
| ], | |
| "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_mk2_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": null, | |
| "vocab_size": 262144 | |
| }, | |
| "tie_word_embeddings": true, | |
| "transformers_version": "5.14.1", | |
| "turn_end_token_id": 106, | |
| "vocab_chunk_size": 32768, | |
| "working_memory_bus": true, | |
| "architectures": [ | |
| "ModilifyMk2ForBlockDiffusion" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_modilify_mk2.ModilifyMk2Config", | |
| "AutoModel": "modeling_modilify_mk2.ModilifyMk2Model", | |
| "AutoModelForCausalLM": "modeling_modilify_mk2.ModilifyMk2ForBlockDiffusion" | |
| }, | |
| "dtype": "bfloat16", | |
| "lora_config": { | |
| "r": 16, | |
| "alpha": 16, | |
| "target_modules": [ | |
| "q_proj", | |
| "k_proj", | |
| "v_proj", | |
| "o_proj", | |
| "gate_proj", | |
| "up_proj", | |
| "down_proj", | |
| "proj" | |
| ], | |
| "expert_r": 8, | |
| "expert_alpha": 8 | |
| }, | |
| "precision_policy": "gdn2_small_fp32_v1", | |
| "global_step": 1250, | |
| "base_model": "google/diffusiongemma-26B-A4B-it" | |
| } | |