Text Generation
Transformers
Safetensors
English
diffusion-gemma
block-diffusion
mixture-of-experts
Mixture of Experts
tinystories
tiny-model
validation
debug-model
Instructions to use shibatch/tinydiffusiongemmamoe4m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shibatch/tinydiffusiongemmamoe4m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="shibatch/tinydiffusiongemmamoe4m")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("shibatch/tinydiffusiongemmamoe4m", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use shibatch/tinydiffusiongemmamoe4m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shibatch/tinydiffusiongemmamoe4m" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shibatch/tinydiffusiongemmamoe4m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/shibatch/tinydiffusiongemmamoe4m
- SGLang
How to use shibatch/tinydiffusiongemmamoe4m 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 "shibatch/tinydiffusiongemmamoe4m" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shibatch/tinydiffusiongemmamoe4m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "shibatch/tinydiffusiongemmamoe4m" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shibatch/tinydiffusiongemmamoe4m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use shibatch/tinydiffusiongemmamoe4m with Docker Model Runner:
docker model run hf.co/shibatch/tinydiffusiongemmamoe4m
| { | |
| "transformers_version": "5.14.1", | |
| "architectures": [ | |
| "DiffusionGemmaForBlockDiffusion" | |
| ], | |
| "output_hidden_states": false, | |
| "return_dict": true, | |
| "dtype": "float32", | |
| "chunk_size_feed_forward": 0, | |
| "is_encoder_decoder": false, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1" | |
| }, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1 | |
| }, | |
| "problem_type": null, | |
| "text_config": { | |
| "architectures": null, | |
| "output_hidden_states": false, | |
| "return_dict": true, | |
| "dtype": "float32", | |
| "chunk_size_feed_forward": 0, | |
| "is_encoder_decoder": false, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1" | |
| }, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1 | |
| }, | |
| "problem_type": null, | |
| "vocab_size": 1003, | |
| "hidden_size": 128, | |
| "intermediate_size": 384, | |
| "num_hidden_layers": 8, | |
| "num_attention_heads": 4, | |
| "num_key_value_heads": 1, | |
| "head_dim": 32, | |
| "hidden_activation": "gelu_pytorch_tanh", | |
| "max_position_embeddings": 1024, | |
| "initializer_range": 0.02, | |
| "rms_norm_eps": 1e-06, | |
| "pad_token_id": 1000, | |
| "eos_token_id": 1001, | |
| "bos_token_id": 1000, | |
| "tie_word_embeddings": true, | |
| "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" | |
| } | |
| }, | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "sliding_window": 64, | |
| "layer_types": [ | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "full_attention" | |
| ], | |
| "use_bidirectional_attention": "vision", | |
| "num_global_key_value_heads": 1, | |
| "global_head_dim": 32, | |
| "num_experts": 4, | |
| "top_k_experts": 2, | |
| "moe_intermediate_size": 192, | |
| "_name_or_path": "", | |
| "model_type": "diffusion_gemma_text", | |
| "output_attentions": false | |
| }, | |
| "vision_config": { | |
| "architectures": null, | |
| "output_hidden_states": false, | |
| "return_dict": true, | |
| "dtype": "float32", | |
| "chunk_size_feed_forward": 0, | |
| "is_encoder_decoder": false, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1" | |
| }, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1 | |
| }, | |
| "problem_type": null, | |
| "hidden_size": 32, | |
| "intermediate_size": 64, | |
| "num_hidden_layers": 1, | |
| "num_attention_heads": 4, | |
| "num_key_value_heads": 4, | |
| "head_dim": 8, | |
| "hidden_activation": "gelu_pytorch_tanh", | |
| "rms_norm_eps": 1e-06, | |
| "max_position_embeddings": 256, | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "rope_parameters": { | |
| "rope_theta": 100.0, | |
| "rope_type": "default" | |
| }, | |
| "pooling_kernel_size": 1, | |
| "patch_size": 16, | |
| "position_embedding_size": 64, | |
| "use_clipped_linears": false, | |
| "standardize": false, | |
| "initializer_range": 0.02, | |
| "_name_or_path": "", | |
| "model_type": "gemma4_vision", | |
| "output_attentions": false | |
| }, | |
| "boi_token_id": 255999, | |
| "eoi_token_id": 258882, | |
| "image_token_id": 258880, | |
| "initializer_range": 0.02, | |
| "tie_word_embeddings": true, | |
| "canvas_length": 8, | |
| "_name_or_path": "/home/codex/tinyModels/runs/diffusion_gemma_100p_scratch_full220k/checkpoints/full-0080000/hf", | |
| "model_type": "diffusion_gemma", | |
| "output_attentions": false | |
| } |