Text Generation
Transformers
Safetensors
English
metadiffusion
diffusion
diffusion-lm
ar-to-diffusion
custom_code
Instructions to use CodeSoft/MetaDiffusion-600M-ChatBase with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CodeSoft/MetaDiffusion-600M-ChatBase with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CodeSoft/MetaDiffusion-600M-ChatBase", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("CodeSoft/MetaDiffusion-600M-ChatBase", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CodeSoft/MetaDiffusion-600M-ChatBase with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CodeSoft/MetaDiffusion-600M-ChatBase" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CodeSoft/MetaDiffusion-600M-ChatBase", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/CodeSoft/MetaDiffusion-600M-ChatBase
- SGLang
How to use CodeSoft/MetaDiffusion-600M-ChatBase 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 "CodeSoft/MetaDiffusion-600M-ChatBase" \ --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": "CodeSoft/MetaDiffusion-600M-ChatBase", "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 "CodeSoft/MetaDiffusion-600M-ChatBase" \ --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": "CodeSoft/MetaDiffusion-600M-ChatBase", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use CodeSoft/MetaDiffusion-600M-ChatBase with Docker Model Runner:
docker model run hf.co/CodeSoft/MetaDiffusion-600M-ChatBase
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,83 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- HuggingFaceTB/smol-smoltalk
|
| 5 |
+
- HuggingFaceH4/no_robots
|
| 6 |
+
- nvidia/OpenMathInstruct-2
|
| 7 |
+
language:
|
| 8 |
+
- en
|
| 9 |
+
base_model:
|
| 10 |
+
- Qwen/Qwen3-0.6B
|
| 11 |
+
pipeline_tag: text-generation
|
| 12 |
+
library_name: transformers
|
| 13 |
+
tags:
|
| 14 |
+
- metadiffusion
|
| 15 |
+
- diffusion
|
| 16 |
+
- diffusion-lm
|
| 17 |
+
- ar-to-diffusion
|
| 18 |
---
|
| 19 |
+
|
| 20 |
+
# MetaDiffusion-600M-ChatBase
|
| 21 |
+
|
| 22 |
+
Experimental bidirectional masked-diffusion chat model converted from Qwen3-0.6B via AR-to-diffusion model surgery (28L x 1024W, ~0.82B params, untied head, bf16, 40K-token context (RoPE base 1e6), Apache-2.0). Intended as a base for further SFT, not a production chatbot.
|
| 23 |
+
|
| 24 |
+
## What this is
|
| 25 |
+
|
| 26 |
+
The AR checkpoint becomes the initialization (weights copied, timestep modules zero-init, the [MASK] and seven auxiliary "rainbow" padding rows are mean-initialized); diffusion behavior is learned throughout training. Trained using smol-smoltalk, no_robots, and OpenMathInstruct-2.
|
| 27 |
+
|
| 28 |
+
## Architecture
|
| 29 |
+
- Blocks: 28 transformer layers, hidden dim 1024, SwiGLU MLP with intermediate 3072, pre-norm RMSNorm (eps 1e-6), QK-norm on. Timestep conditioning is a sinusoidal MLP embedding (1024) feeding per-block adaLN-style scale+shift modulation.
|
| 30 |
+
|
| 31 |
+
- Attention: GQA with 16 query heads / 8 KV heads, head_dim 128. Bidirectional self-attention with no causal mask.
|
| 32 |
+
|
| 33 |
+
- Context: 40,960 tokens max (RoPE, base theta 1e6).
|
| 34 |
+
|
| 35 |
+
- Params: 0.82B total with untied embeddings: embed_tokens 151,677 x 1024 and a separate lm_head of the same size.
|
| 36 |
+
|
| 37 |
+
- Vocab / IO: 151,677 rows = Qwen3's 151,669 + [MASK] (id 151669) + 7 rainbow padding tokens (151670-151676); pad_token_id is <|endoftext|> (151643), eos is <|im_end|> (151645). bf16 weights, 371 tensors in model.safetensors.
|
| 38 |
+
|
| 39 |
+
## Use with Transformers
|
| 40 |
+
|
| 41 |
+
```python
|
| 42 |
+
import torch
|
| 43 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 44 |
+
|
| 45 |
+
repo = "CodeSoft/MetaDiffusion-600M-ChatBase"
|
| 46 |
+
|
| 47 |
+
m = AutoModelForCausalLM.from_pretrained(
|
| 48 |
+
repo,
|
| 49 |
+
trust_remote_code=True,
|
| 50 |
+
dtype=torch.bfloat16,
|
| 51 |
+
).to("cuda")
|
| 52 |
+
|
| 53 |
+
tok = AutoTokenizer.from_pretrained(
|
| 54 |
+
repo,
|
| 55 |
+
subfolder="tokenizer",
|
| 56 |
+
trust_remote_code=True,
|
| 57 |
+
)
|
| 58 |
+
|
| 59 |
+
prompt = tok.apply_chat_template(
|
| 60 |
+
[{"role": "user", "content": "hi"}],
|
| 61 |
+
tokenize=False,
|
| 62 |
+
add_generation_prompt=True,
|
| 63 |
+
)
|
| 64 |
+
|
| 65 |
+
inputs = tok(prompt, return_tensors="pt").to("cuda")
|
| 66 |
+
|
| 67 |
+
with torch.inference_mode():
|
| 68 |
+
out = m.generate(
|
| 69 |
+
**inputs,
|
| 70 |
+
max_new_tokens=100,
|
| 71 |
+
)
|
| 72 |
+
|
| 73 |
+
print(tok.decode(out[0], skip_special_tokens=True))
|
| 74 |
+
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
## Limitations
|
| 78 |
+
|
| 79 |
+
This model is an experimental research checkpoint intended for further fine-tuning and experimentation. It is not optimized for instruction-following, factuality, safety, or production deployment. Behavior may differ substantially from the original Qwen3-0.6B-Instruct model.
|
| 80 |
+
|
| 81 |
+
## License
|
| 82 |
+
|
| 83 |
+
Apache-2.0
|