Instructions to use eousphoros/turnstone-lambda-671.2-bf16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use eousphoros/turnstone-lambda-671.2-bf16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="eousphoros/turnstone-lambda-671.2-bf16") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("eousphoros/turnstone-lambda-671.2-bf16") model = AutoModelForMultimodalLM.from_pretrained("eousphoros/turnstone-lambda-671.2-bf16", device_map="auto") 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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use eousphoros/turnstone-lambda-671.2-bf16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "eousphoros/turnstone-lambda-671.2-bf16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "eousphoros/turnstone-lambda-671.2-bf16", "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/eousphoros/turnstone-lambda-671.2-bf16
- SGLang
How to use eousphoros/turnstone-lambda-671.2-bf16 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 "eousphoros/turnstone-lambda-671.2-bf16" \ --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": "eousphoros/turnstone-lambda-671.2-bf16", "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 "eousphoros/turnstone-lambda-671.2-bf16" \ --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": "eousphoros/turnstone-lambda-671.2-bf16", "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 eousphoros/turnstone-lambda-671.2-bf16 with Docker Model Runner:
docker model run hf.co/eousphoros/turnstone-lambda-671.2-bf16
Commit ·
678035d
0
Parent(s):
Turnstone Lambda 671.2 (BF16)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +36 -0
- README.md +42 -0
- SHA256SUMS +69 -0
- chat_template.jinja +170 -0
- config.json +140 -0
- dspark/README.md +16 -0
- dspark/calibration.json +281 -0
- dspark/config.json +118 -0
- dspark/config.py +67 -0
- dspark/model.safetensors +3 -0
- generation_config.json +12 -0
- merges.txt +0 -0
- model-part-00001.safetensors +3 -0
- model-part-00002.safetensors +3 -0
- model-part-00003.safetensors +3 -0
- model-part-00004.safetensors +3 -0
- model-part-00005.safetensors +3 -0
- model-part-00006.safetensors +3 -0
- model-part-00007.safetensors +3 -0
- model-part-00008.safetensors +3 -0
- model-part-00009.safetensors +3 -0
- model-part-00010.safetensors +3 -0
- model-part-00011.safetensors +3 -0
- model-part-00012.safetensors +3 -0
- model-part-00013.safetensors +3 -0
- model-part-00014.safetensors +3 -0
- model-part-00015.safetensors +3 -0
- model-part-00016.safetensors +3 -0
- model-part-00017.safetensors +3 -0
- model-part-00018.safetensors +3 -0
- model-part-00019.safetensors +3 -0
- model-part-00020.safetensors +3 -0
- model-part-00021.safetensors +3 -0
- model-part-00022.safetensors +3 -0
- model-part-00023.safetensors +3 -0
- model-part-00024.safetensors +3 -0
- model-part-00025.safetensors +3 -0
- model-part-00026.safetensors +3 -0
- model-part-00027.safetensors +3 -0
- model-part-00028.safetensors +3 -0
- model-part-00029.safetensors +3 -0
- model-part-00030.safetensors +3 -0
- model-part-00031.safetensors +3 -0
- model-part-00032.safetensors +3 -0
- model-part-00033.safetensors +3 -0
- model-part-00034.safetensors +3 -0
- model-part-00035.safetensors +3 -0
- model-part-00036.safetensors +3 -0
- model-part-00037.safetensors +3 -0
- model-part-00038.safetensors +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
pipeline_tag: image-text-to-text
|
| 5 |
+
base_model: eousphoros/turnstone-lambda-671
|
| 6 |
+
base_model_relation: finetune
|
| 7 |
+
tags:
|
| 8 |
+
- experimental
|
| 9 |
+
- preview
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# Turnstone Lambda 671.2 (BF16)
|
| 13 |
+
|
| 14 |
+
Turnstone Lambda 671.2 as BF16 weights (FP32 `A_log`), with the vision tower, and a DSpark draft head for speculative
|
| 15 |
+
decoding in `dspark/`.
|
| 16 |
+
|
| 17 |
+
FP32 masters and export tools: [eousphoros/turnstone-lambda-671](https://huggingface.co/eousphoros/turnstone-lambda-671). FP8:
|
| 18 |
+
[eousphoros/turnstone-lambda-671.2-fp8](https://huggingface.co/eousphoros/turnstone-lambda-671.2-fp8).
|
| 19 |
+
|
| 20 |
+
## Benchmarks
|
| 21 |
+
|
| 22 |
+
Our harness: vLLM 0.32 on a GB300, reasoning effort xhigh, up to 128k completion tokens, sampling as in
|
| 23 |
+
`generation_config.json`.
|
| 24 |
+
|
| 25 |
+
| Benchmark | 671.2 |
|
| 26 |
+
|---|---|
|
| 27 |
+
| GPQA Diamond, 4 samples per question | 86.4 |
|
| 28 |
+
| IFBench, prompt-level strict | 71.0 |
|
| 29 |
+
| LiveCodeBench v6, all 175 problems | 85.7 |
|
| 30 |
+
| LiveCodeBench v6, 2025-02 to 2025-05 (131 problems) | 85.5 |
|
| 31 |
+
| XSTest, safe prompts: full compliance (judged by Qwen3.8-27B) | 95.2 |
|
| 32 |
+
| XSTest, unsafe prompts: full refusal | 76.5 |
|
| 33 |
+
|
| 34 |
+
## Serving
|
| 35 |
+
|
| 36 |
+
vllm serve eousphoros/turnstone-lambda-671.2-bf16 --reasoning-parser qwen3 --enable-auto-tool-choice --tool-call-parser qwen3_coder
|
| 37 |
+
|
| 38 |
+
With the DSpark draft head, from a local copy (`hf download eousphoros/turnstone-lambda-671.2-bf16 --local-dir turnstone-lambda-671.2-bf16`):
|
| 39 |
+
|
| 40 |
+
vllm serve turnstone-lambda-671.2-bf16 --reasoning-parser qwen3 --enable-auto-tool-choice --tool-call-parser qwen3_coder --speculative-config '{"model": "turnstone-lambda-671.2-bf16/dspark", "method": "dspark", "num_speculative_tokens": 5, "draft_sample_method": "probabilistic"}'
|
| 41 |
+
|
| 42 |
+
License: Apache-2.0, as the base.
|
SHA256SUMS
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
c3cf9e34abf4f9e36c2d72165aa9c132d3e2a725b6c2586aaa3a8af9d7a81041 chat_template.jinja
|
| 2 |
+
191e0af232104ed8b65258cf3fb2b842e288008baca7633c11b82a1ac7203aab config.json
|
| 3 |
+
0960adc9e17c1ecfe09f464baaa53f9713b5bc4c055c4f840a0db528667bb500 dspark/README.md
|
| 4 |
+
2e00c11d3ff99f1d6696319b17c58d62b6f5d4d1a5cb933852e361590286803d dspark/calibration.json
|
| 5 |
+
42c6f5b3f9fa1ce42da60fb801753bfd4e5c6197f7d464e1df5c1f9d3bee17f4 dspark/config.json
|
| 6 |
+
2f4381ff2eb9de506c6ba09bc17f83d0aee871f75651f6303b2e4b581e9b4ca1 dspark/config.py
|
| 7 |
+
1a439c748135b7b352a36c5168147d18e70356135e244c09553dbd9d64fcbe67 dspark/model.safetensors
|
| 8 |
+
e70c136c1b78ddc1fb0905bac8e733a4dc448d4f852a5dd75143fffc70be550e generation_config.json
|
| 9 |
+
a9d356d7bdf1ef4949e3e748e95b8e10ad9d4e2e838eddc38a0a7b6b94d1db8d merges.txt
|
| 10 |
+
355e8ef5db712fc78cf66a83bb05c326327543a8656d237be9250468c630b80a model-part-00001.safetensors
|
| 11 |
+
5d38d109779e8bd1217615cbfc12c6a12bb3ccb58914334f50050f74921cb147 model-part-00002.safetensors
|
| 12 |
+
2425df3662d1e5e51f0f6df53627c8dd33a51c99a6c50098b5aae05849f6cfef model-part-00003.safetensors
|
| 13 |
+
86c20299125a968445e3656026d3d55fcca8a8bdb6257e472eee811526de0520 model-part-00004.safetensors
|
| 14 |
+
69a8675c1ee3d6c995f9ee22b34c4d3b42bc1ab94e15d677e09a4e40c901febc model-part-00005.safetensors
|
| 15 |
+
8138bfce52c2ff894011a836beea56987a78bdd2d79a6d8c9c11faf9c699db5b model-part-00006.safetensors
|
| 16 |
+
7d50194d48442c518f163953a30cee8462d142e70adb2849130a0723d773e5e5 model-part-00007.safetensors
|
| 17 |
+
cb327577eee3f16403d74b415c28985c4c0b206d56d026bb0eb0e65d5c025cad model-part-00008.safetensors
|
| 18 |
+
4deec02ee9bf42b75355580cefcdac95b9c817dd76335b57e6ed7b5a8cc96ed8 model-part-00009.safetensors
|
| 19 |
+
65c6a6767917c789f3860708c3fa045dac2db2d65247b861bd761c27d5113922 model-part-00010.safetensors
|
| 20 |
+
b601b68fc5191630cccae61aea2a1228f6e89260f57307a037bf4b084686dfb6 model-part-00011.safetensors
|
| 21 |
+
ca68b23539ee66a02e41cef4d358f315df4cf3326d89d2f5e48e7258207e83ef model-part-00012.safetensors
|
| 22 |
+
a5dc6a27a8bf1c918712c7960b5427903460308d707e91eb0dbe64fdc0dbd56b model-part-00013.safetensors
|
| 23 |
+
de944ba4f3e23aeef9ac3d2ca276501bf4d1d964e8c6c6d402e801e6a7bfb872 model-part-00014.safetensors
|
| 24 |
+
3910a5ca7ddb52635862a7f96fc1443f936296f7c5abb37071a8e3105725890d model-part-00015.safetensors
|
| 25 |
+
2740a1b30966d8bbdfe016b914569fb12f5f8fdedee483a0f84f222fef7cda5f model-part-00016.safetensors
|
| 26 |
+
7ead010e4a0867b3b6f7456e68ae9e4e45f6aa8cb2b73b39a63ec1422fc483e1 model-part-00017.safetensors
|
| 27 |
+
0c51e80e571d37e252a43a2ca3c227aff22cbad36f1d5028c2b29702040f4b2e model-part-00018.safetensors
|
| 28 |
+
9c92d328c3fd6be184dd48304fc23755e420d0175a91baa2b43fc573a9e37499 model-part-00019.safetensors
|
| 29 |
+
aca2eb2fd929013d9311874bb7ad6e4cc2fe0ae5d822def0776eb2c67e4d1cb3 model-part-00020.safetensors
|
| 30 |
+
44a623cffda80279819ccea3d0be8f0ff392d41351baaaa2b7a166da1b366281 model-part-00021.safetensors
|
| 31 |
+
65206f3aa08f052790196d3dd44463df481ea1426046e4af08113fb432468412 model-part-00022.safetensors
|
| 32 |
+
e0c88e58e4c9dd4e2c16f1b5ec2115b3f16557b47af1d0609979722da4162076 model-part-00023.safetensors
|
| 33 |
+
a98fd93b3dd41b18e075ca858d25b1647b23285aa58f3d20995553fb3f710f70 model-part-00024.safetensors
|
| 34 |
+
220e071ec484a434ca583dec6418dbc8e36aaf3f328fafc109049d07d8815a93 model-part-00025.safetensors
|
| 35 |
+
6182e25c289fc9bc205375588d63dbdd5dadfcf76b14e33d3b1e17821c4a8fa6 model-part-00026.safetensors
|
| 36 |
+
9800e60e910ce72fd14e46e08f4aa8a871aeaf85a87373bd2c80bf11c3c37ac4 model-part-00027.safetensors
|
| 37 |
+
abff8dffc00cc9c33b1c06a81d7062f1d0f9fe5e20bff0c1271fc892c60594cc model-part-00028.safetensors
|
| 38 |
+
85ca88f093cabd5c5fcdc5278ae150d373ed1febdbf1a1e4c3e0fb809136e6f9 model-part-00029.safetensors
|
| 39 |
+
fa177e9693cfdc86eeb4016128dc66cde03f9153dbbf366459d8626a097d123a model-part-00030.safetensors
|
| 40 |
+
a64428c2e4335b4952feb04746ed28e224ef8f2805658860390a0e4437a1105c model-part-00031.safetensors
|
| 41 |
+
d9f93d7c6fb37449a0007bc2d0ddac7ee1ed0783f5e7189cde854c9fabf39c85 model-part-00032.safetensors
|
| 42 |
+
f2c8d32bdd81f4934063f37b5919a70ef6c67e1fc218de325986feeaf7bcedd0 model-part-00033.safetensors
|
| 43 |
+
a7cf1af2b8b087f73011364f516e2e2aed520449cff47fb396a08c9d459b5992 model-part-00034.safetensors
|
| 44 |
+
724e02f19e5754a69580e8d68a6ace282a6653cf90716cfbaebacb7357439e62 model-part-00035.safetensors
|
| 45 |
+
a49fda88475a3fd61223400bb25da1c0bad34682ef2cdf3c6328f7dc43fc9333 model-part-00036.safetensors
|
| 46 |
+
32cff9dc7952a20f7802e4fd225aa64966f4e943344b0cec2b2a4a471498d197 model-part-00037.safetensors
|
| 47 |
+
9266155dc32cfad702bb5fd6c704fd5025728249c0b0c5336efac4d48218c4c3 model-part-00038.safetensors
|
| 48 |
+
1f4cf2051d8f2ac8ad60c28e824e28ca0a42daf4422703cbc9b94325acde470f model-part-00039.safetensors
|
| 49 |
+
63d3271c676aec86819bc0e57d97ce63056a77b9638dbfa8c3e51cf10085e7aa model-part-00040.safetensors
|
| 50 |
+
e069d660452ac887df2d97122978dd49d44242c4b20f6488695740e02dd5eac4 model-part-00041.safetensors
|
| 51 |
+
578191335a368a4836b0bb116ac07b2131be78e54b2b769b2764b6e4caea76a7 model-part-00042.safetensors
|
| 52 |
+
f12325f953bf54e71c52c7c968a23d480582414c472b1facf83132deb41f1bfd model-part-00043.safetensors
|
| 53 |
+
dae6194c8731b39ed68022549ba8fcca38d71cdf0eecc9aae9c95a4e2120e995 model-part-00044.safetensors
|
| 54 |
+
21f32bf67820dec1aadfad9e0686243f1aaf5da402bc5f24d4e9a540a5abd4fd model-part-00045.safetensors
|
| 55 |
+
ae4add49901f15a7b4ab27166832cc9dc383ca724e966d0f934f4731a4f2a4cd model-part-00046.safetensors
|
| 56 |
+
6845e64b4f134befde7ca014a5ea3f627a9e4957c8b239a6c715704baf33ffa8 model-part-00047.safetensors
|
| 57 |
+
ccaa75dbd86cbfb38d8d2d3b739b7396f9fe2452342095f94bf537e1b9f253ee model-part-00048.safetensors
|
| 58 |
+
ab6ebd0de7006019260971f570ec5479d6d78759e61fa03cf0fdfb2b40ab81a0 model-part-00049.safetensors
|
| 59 |
+
2b5bcf9543277abb6d4b4790a6439102df57e8e186617e9c5b1fd7f2a2b6f9ed model-part-00050.safetensors
|
| 60 |
+
79d301df5f7a5de7ecf78c77e8cdcb140b89537a51e95b280741677b010f4701 model-part-00051.safetensors
|
| 61 |
+
dd32076c103cf6e3a1757b0e1173fef02548ce5d97815c491290701c500995f8 model-part-00052.safetensors
|
| 62 |
+
04ead6f722de6bfc6b8f63c85bcdd27fa77269f2edcd433233f452a526180b0f model-part-00053.safetensors
|
| 63 |
+
a822f7b4f12ebe32f9a3be4dd9c4159b3daf11561c2710bde24a5ee07d52870e model.safetensors.index.json
|
| 64 |
+
4985cb933293e0fc9436c679d83289f250dc6708b3de43288e7f7f67cba8bd40 mtp.safetensors
|
| 65 |
+
27225450ac9c6529872ee1924fcb0962ff5634834f817040f444118116f4e516 preprocessor_config.json
|
| 66 |
+
0997f410c57a1f4e53b09e4be8f4a172d90edd9564368fb0847030937229b9f3 tokenizer.json
|
| 67 |
+
b11349aafa7cdc6a320767cf7ceb29ed82f7eda5d65e8e0819e76f0ce947bf27 tokenizer_config.json
|
| 68 |
+
7768af27c1fafa9cc9011c1dc20067e03f8915e03b63504550e11d5066986d13 video_preprocessor_config.json
|
| 69 |
+
ce99b4cb2983d118806ce0a8b777a35b093e2000a503ebde25853284c9dfa003 vocab.json
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- set image_count = namespace(value=0) %}
|
| 2 |
+
{%- set video_count = namespace(value=0) %}
|
| 3 |
+
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
| 4 |
+
{%- if content is string %}
|
| 5 |
+
{{- content }}
|
| 6 |
+
{%- elif content is iterable and content is not mapping %}
|
| 7 |
+
{%- for item in content %}
|
| 8 |
+
{%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
|
| 9 |
+
{%- if is_system_content %}
|
| 10 |
+
{{- raise_exception('System message cannot contain images.') }}
|
| 11 |
+
{%- endif %}
|
| 12 |
+
{%- if do_vision_count %}
|
| 13 |
+
{%- set image_count.value = image_count.value + 1 %}
|
| 14 |
+
{%- endif %}
|
| 15 |
+
{%- if add_vision_id %}
|
| 16 |
+
{{- 'Picture ' ~ image_count.value ~ ': ' }}
|
| 17 |
+
{%- endif %}
|
| 18 |
+
{{- '<|vision_start|><|image_pad|><|vision_end|>' }}
|
| 19 |
+
{%- elif 'video' in item or item.type == 'video' %}
|
| 20 |
+
{%- if is_system_content %}
|
| 21 |
+
{{- raise_exception('System message cannot contain videos.') }}
|
| 22 |
+
{%- endif %}
|
| 23 |
+
{%- if do_vision_count %}
|
| 24 |
+
{%- set video_count.value = video_count.value + 1 %}
|
| 25 |
+
{%- endif %}
|
| 26 |
+
{%- if add_vision_id %}
|
| 27 |
+
{{- 'Video ' ~ video_count.value ~ ': ' }}
|
| 28 |
+
{%- endif %}
|
| 29 |
+
{{- '<|vision_start|><|video_pad|><|vision_end|>' }}
|
| 30 |
+
{%- elif 'text' in item %}
|
| 31 |
+
{{- item.text }}
|
| 32 |
+
{%- else %}
|
| 33 |
+
{{- raise_exception('Unexpected item type in content.') }}
|
| 34 |
+
{%- endif %}
|
| 35 |
+
{%- endfor %}
|
| 36 |
+
{%- elif content is none or content is undefined %}
|
| 37 |
+
{{- '' }}
|
| 38 |
+
{%- else %}
|
| 39 |
+
{{- raise_exception('Unexpected content type.') }}
|
| 40 |
+
{%- endif %}
|
| 41 |
+
{%- endmacro %}
|
| 42 |
+
{%- if not messages %}
|
| 43 |
+
{{- raise_exception('No messages provided.') }}
|
| 44 |
+
{%- endif %}
|
| 45 |
+
{%- set reasoning_instructions = '' %}
|
| 46 |
+
{%- if enable_thinking is undefined or enable_thinking is true %}
|
| 47 |
+
{%- set resolved_reasoning_effort = reasoning_effort|default('xhigh') %}
|
| 48 |
+
{%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low') %}
|
| 49 |
+
{{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low.') }}
|
| 50 |
+
{%- endif %}
|
| 51 |
+
{%- if resolved_reasoning_effort == 'xhigh' %}
|
| 52 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}
|
| 53 |
+
{%- elif resolved_reasoning_effort == 'low' %}
|
| 54 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}
|
| 55 |
+
{%- endif %}
|
| 56 |
+
{%- endif %}
|
| 57 |
+
{%- if tools and tools is iterable and tools is not mapping %}
|
| 58 |
+
{{- '<|im_start|>system\n' }}
|
| 59 |
+
{%- if reasoning_instructions %}
|
| 60 |
+
{{- reasoning_instructions + '\n\n' }}
|
| 61 |
+
{%- endif %}
|
| 62 |
+
{{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
|
| 63 |
+
{%- for tool in tools %}
|
| 64 |
+
{{- "\n" }}
|
| 65 |
+
{{- tool | tojson }}
|
| 66 |
+
{%- endfor %}
|
| 67 |
+
{{- "\n</tools>" }}
|
| 68 |
+
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
| 69 |
+
{%- if messages[0].role == 'system' %}
|
| 70 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 71 |
+
{%- if content %}
|
| 72 |
+
{{- '\n\n' + content }}
|
| 73 |
+
{%- endif %}
|
| 74 |
+
{%- endif %}
|
| 75 |
+
{{- '<|im_end|>\n' }}
|
| 76 |
+
{%- else %}
|
| 77 |
+
{%- if messages[0].role == 'system' %}
|
| 78 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 79 |
+
{%- if content %}
|
| 80 |
+
{{- '<|im_start|>system\n' + (reasoning_instructions + '\n\n' if reasoning_instructions else '') + content + '<|im_end|>\n' }}
|
| 81 |
+
{%- elif reasoning_instructions %}
|
| 82 |
+
{{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
|
| 83 |
+
{%- endif %}
|
| 84 |
+
{%- elif reasoning_instructions %}
|
| 85 |
+
{{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
|
| 86 |
+
{%- endif %}
|
| 87 |
+
{%- endif %}
|
| 88 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 89 |
+
{%- for message in messages[::-1] %}
|
| 90 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 91 |
+
{%- if ns.multi_step_tool and message.role == "user" %}
|
| 92 |
+
{%- set content = render_content(message.content, false)|trim %}
|
| 93 |
+
{%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
|
| 94 |
+
{%- set ns.multi_step_tool = false %}
|
| 95 |
+
{%- set ns.last_query_index = index %}
|
| 96 |
+
{%- endif %}
|
| 97 |
+
{%- endif %}
|
| 98 |
+
{%- endfor %}
|
| 99 |
+
{%- if ns.multi_step_tool %}
|
| 100 |
+
{{- raise_exception('No user query found in messages.') }}
|
| 101 |
+
{%- endif %}
|
| 102 |
+
{%- for message in messages %}
|
| 103 |
+
{%- set content = render_content(message.content, true)|trim %}
|
| 104 |
+
{%- if message.role == "system" %}
|
| 105 |
+
{%- if not loop.first %}
|
| 106 |
+
{{- raise_exception('System message must be at the beginning.') }}
|
| 107 |
+
{%- endif %}
|
| 108 |
+
{%- elif message.role == "user" %}
|
| 109 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 110 |
+
{%- elif message.role == "assistant" %}
|
| 111 |
+
{%- set reasoning_content = '' %}
|
| 112 |
+
{%- if message.reasoning_content is string %}
|
| 113 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 114 |
+
{%- endif %}
|
| 115 |
+
{%- set reasoning_content = reasoning_content|trim %}
|
| 116 |
+
{%- if preserve_thinking is undefined or preserve_thinking is true or loop.index0 > ns.last_query_index %}
|
| 117 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
| 118 |
+
{%- else %}
|
| 119 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 120 |
+
{%- endif %}
|
| 121 |
+
{%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 122 |
+
{%- for tool_call in message.tool_calls %}
|
| 123 |
+
{%- if tool_call.function is defined %}
|
| 124 |
+
{%- set tool_call = tool_call.function %}
|
| 125 |
+
{%- endif %}
|
| 126 |
+
{%- if loop.first %}
|
| 127 |
+
{%- if content|trim %}
|
| 128 |
+
{{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 129 |
+
{%- else %}
|
| 130 |
+
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 131 |
+
{%- endif %}
|
| 132 |
+
{%- else %}
|
| 133 |
+
{{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 134 |
+
{%- endif %}
|
| 135 |
+
{%- if tool_call.arguments is defined and tool_call.arguments != '' %}
|
| 136 |
+
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 137 |
+
{{- '<parameter=' + args_name + '>\n' }}
|
| 138 |
+
{%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}
|
| 139 |
+
{{- args_value }}
|
| 140 |
+
{{- '\n</parameter>\n' }}
|
| 141 |
+
{%- endfor %}
|
| 142 |
+
{%- endif %}
|
| 143 |
+
{{- '</function>\n</tool_call>' }}
|
| 144 |
+
{%- endfor %}
|
| 145 |
+
{%- endif %}
|
| 146 |
+
{{- '<|im_end|>\n' }}
|
| 147 |
+
{%- elif message.role == "tool" %}
|
| 148 |
+
{%- if loop.previtem and loop.previtem.role != "tool" %}
|
| 149 |
+
{{- '<|im_start|>user' }}
|
| 150 |
+
{%- endif %}
|
| 151 |
+
{{- '\n<tool_response>\n' }}
|
| 152 |
+
{{- content }}
|
| 153 |
+
{{- '\n</tool_response>' }}
|
| 154 |
+
{%- if not loop.last and loop.nextitem.role != "tool" %}
|
| 155 |
+
{{- '<|im_end|>\n' }}
|
| 156 |
+
{%- elif loop.last %}
|
| 157 |
+
{{- '<|im_end|>\n' }}
|
| 158 |
+
{%- endif %}
|
| 159 |
+
{%- else %}
|
| 160 |
+
{{- raise_exception('Unexpected message role.') }}
|
| 161 |
+
{%- endif %}
|
| 162 |
+
{%- endfor %}
|
| 163 |
+
{%- if add_generation_prompt %}
|
| 164 |
+
{{- '<|im_start|>assistant\n' }}
|
| 165 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 166 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 167 |
+
{%- else %}
|
| 168 |
+
{{- '<think>\n' }}
|
| 169 |
+
{%- endif %}
|
| 170 |
+
{%- endif %}
|
config.json
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen3_5ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"image_token_id": 248056,
|
| 6 |
+
"language_model_only": false,
|
| 7 |
+
"model_type": "qwen3_5",
|
| 8 |
+
"text_config": {
|
| 9 |
+
"attention_bias": false,
|
| 10 |
+
"attention_dropout": 0.0,
|
| 11 |
+
"attn_output_gate": true,
|
| 12 |
+
"bos_token_id": 248044,
|
| 13 |
+
"dtype": "bfloat16",
|
| 14 |
+
"eos_token_id": 248044,
|
| 15 |
+
"full_attention_interval": 4,
|
| 16 |
+
"head_dim": 256,
|
| 17 |
+
"hidden_act": "silu",
|
| 18 |
+
"hidden_size": 5120,
|
| 19 |
+
"initializer_range": 0.02,
|
| 20 |
+
"intermediate_size": 17408,
|
| 21 |
+
"layer_types": [
|
| 22 |
+
"linear_attention",
|
| 23 |
+
"linear_attention",
|
| 24 |
+
"linear_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"linear_attention",
|
| 27 |
+
"linear_attention",
|
| 28 |
+
"linear_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"linear_attention",
|
| 31 |
+
"linear_attention",
|
| 32 |
+
"linear_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"linear_attention",
|
| 35 |
+
"linear_attention",
|
| 36 |
+
"linear_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"linear_attention",
|
| 39 |
+
"linear_attention",
|
| 40 |
+
"linear_attention",
|
| 41 |
+
"full_attention",
|
| 42 |
+
"linear_attention",
|
| 43 |
+
"linear_attention",
|
| 44 |
+
"linear_attention",
|
| 45 |
+
"full_attention",
|
| 46 |
+
"linear_attention",
|
| 47 |
+
"linear_attention",
|
| 48 |
+
"linear_attention",
|
| 49 |
+
"full_attention",
|
| 50 |
+
"linear_attention",
|
| 51 |
+
"linear_attention",
|
| 52 |
+
"linear_attention",
|
| 53 |
+
"full_attention",
|
| 54 |
+
"linear_attention",
|
| 55 |
+
"linear_attention",
|
| 56 |
+
"linear_attention",
|
| 57 |
+
"full_attention",
|
| 58 |
+
"linear_attention",
|
| 59 |
+
"linear_attention",
|
| 60 |
+
"linear_attention",
|
| 61 |
+
"full_attention",
|
| 62 |
+
"linear_attention",
|
| 63 |
+
"linear_attention",
|
| 64 |
+
"linear_attention",
|
| 65 |
+
"full_attention",
|
| 66 |
+
"linear_attention",
|
| 67 |
+
"linear_attention",
|
| 68 |
+
"linear_attention",
|
| 69 |
+
"full_attention",
|
| 70 |
+
"linear_attention",
|
| 71 |
+
"linear_attention",
|
| 72 |
+
"linear_attention",
|
| 73 |
+
"full_attention",
|
| 74 |
+
"linear_attention",
|
| 75 |
+
"linear_attention",
|
| 76 |
+
"linear_attention",
|
| 77 |
+
"full_attention",
|
| 78 |
+
"linear_attention",
|
| 79 |
+
"linear_attention",
|
| 80 |
+
"linear_attention",
|
| 81 |
+
"full_attention",
|
| 82 |
+
"linear_attention",
|
| 83 |
+
"linear_attention",
|
| 84 |
+
"linear_attention",
|
| 85 |
+
"full_attention"
|
| 86 |
+
],
|
| 87 |
+
"linear_conv_kernel_dim": 4,
|
| 88 |
+
"linear_key_head_dim": 128,
|
| 89 |
+
"linear_num_key_heads": 16,
|
| 90 |
+
"linear_num_value_heads": 48,
|
| 91 |
+
"linear_value_head_dim": 128,
|
| 92 |
+
"mamba_ssm_dtype": "float32",
|
| 93 |
+
"max_position_embeddings": 262144,
|
| 94 |
+
"model_type": "qwen3_5_text",
|
| 95 |
+
"mtp_num_hidden_layers": 1,
|
| 96 |
+
"mtp_use_dedicated_embeddings": false,
|
| 97 |
+
"num_attention_heads": 24,
|
| 98 |
+
"num_hidden_layers": 64,
|
| 99 |
+
"num_key_value_heads": 4,
|
| 100 |
+
"output_gate_type": "swish",
|
| 101 |
+
"pad_token_id": null,
|
| 102 |
+
"partial_rotary_factor": 0.25,
|
| 103 |
+
"rms_norm_eps": 1e-06,
|
| 104 |
+
"rope_parameters": {
|
| 105 |
+
"mrope_interleaved": true,
|
| 106 |
+
"mrope_section": [
|
| 107 |
+
11,
|
| 108 |
+
11,
|
| 109 |
+
10
|
| 110 |
+
],
|
| 111 |
+
"partial_rotary_factor": 0.25,
|
| 112 |
+
"rope_theta": 10000000,
|
| 113 |
+
"rope_type": "default"
|
| 114 |
+
},
|
| 115 |
+
"tie_word_embeddings": false,
|
| 116 |
+
"use_cache": true,
|
| 117 |
+
"vocab_size": 248320
|
| 118 |
+
},
|
| 119 |
+
"tie_word_embeddings": false,
|
| 120 |
+
"transformers_version": "5.8.0.dev0",
|
| 121 |
+
"video_token_id": 248057,
|
| 122 |
+
"vision_config": {
|
| 123 |
+
"deepstack_visual_indexes": [],
|
| 124 |
+
"depth": 27,
|
| 125 |
+
"hidden_act": "gelu_pytorch_tanh",
|
| 126 |
+
"hidden_size": 1152,
|
| 127 |
+
"in_channels": 3,
|
| 128 |
+
"initializer_range": 0.02,
|
| 129 |
+
"intermediate_size": 4304,
|
| 130 |
+
"model_type": "qwen3_5",
|
| 131 |
+
"num_heads": 16,
|
| 132 |
+
"num_position_embeddings": 2304,
|
| 133 |
+
"out_hidden_size": 5120,
|
| 134 |
+
"patch_size": 16,
|
| 135 |
+
"spatial_merge_size": 2,
|
| 136 |
+
"temporal_patch_size": 2
|
| 137 |
+
},
|
| 138 |
+
"vision_end_token_id": 248054,
|
| 139 |
+
"vision_start_token_id": 248053
|
| 140 |
+
}
|
dspark/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DSpark draft head
|
| 2 |
+
|
| 3 |
+
A block draft head (semi-autoregressive, with Markov and confidence heads) for speculative decoding with Turnstone
|
| 4 |
+
Lambda 671.2. It was fine-tuned from
|
| 5 |
+
[RedHatAI/Qwen3.8-27B-speculator.dspark](https://huggingface.co/RedHatAI/Qwen3.8-27B-speculator.dspark) (Apache-2.0)
|
| 6 |
+
to match the sampling distribution of Turnstone Lambda 671, which 671.2 is built on.
|
| 7 |
+
|
| 8 |
+
- `model.safetensors`: projection matrices in FP8 (e4m3, 128 x 128 block scales), BF16 elsewhere. The head was trained
|
| 9 |
+
with these rounded weights in the forward.
|
| 10 |
+
- `calibration.json`: how the head was made.
|
| 11 |
+
|
| 12 |
+
Serve with vLLM 0.34 or later, drafting 5 tokens with probabilistic draft sampling:
|
| 13 |
+
|
| 14 |
+
--speculative-config '{"model": "path/to/turnstone-lambda-671.2-bf16/dspark", "method": "dspark", "num_speculative_tokens": 5, "draft_sample_method": "probabilistic"}'
|
| 15 |
+
|
| 16 |
+
License: Apache-2.0, as the base head.
|
dspark/calibration.json
ADDED
|
@@ -0,0 +1,281 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"written": "2026-11-26T14:50:42Z",
|
| 3 |
+
"format": "fp8 (e4m3, 128 x 128 block scales) projection matrices, BF16 elsewhere",
|
| 4 |
+
"base": {
|
| 5 |
+
"folder": "/heads/RedHatAI--Qwen3.8-27B-speculator.dspark",
|
| 6 |
+
"model_sha256": "6cf6f33fbb2dfd7e74f8009132f0a2a2b4c71cd6cce9360a7d4145c9218f1781",
|
| 7 |
+
"config_sha256": "6b2b39729c0afcac855b4b9808a85d8d323f2e4ca754749861c922dcc3c50a40"
|
| 8 |
+
},
|
| 9 |
+
"state": {
|
| 10 |
+
"file": "/data/step0011/train/best.pt",
|
| 11 |
+
"update": 275,
|
| 12 |
+
"metric": "tokens_per_step_uniform_k5",
|
| 13 |
+
"value": 3.982853643681106,
|
| 14 |
+
"fp8_aware": true
|
| 15 |
+
},
|
| 16 |
+
"target": "persona_lambda_27b_v10_eot_l61-63r4_mtp3_grpo-mixed-2",
|
| 17 |
+
"tensors": 62,
|
| 18 |
+
"quantized_matrices": 36,
|
| 19 |
+
"tensors_changed": 57,
|
| 20 |
+
"largest_mean_relative_change": 0.03049054906589716,
|
| 21 |
+
"model_sha256": "1a439c748135b7b352a36c5168147d18e70356135e244c09553dbd9d64fcbe67",
|
| 22 |
+
"masters_fp32": {
|
| 23 |
+
"folder": "/data/step0011/head.dspark.masters-fp32",
|
| 24 |
+
"model_sha256": "11003734d04969683941e92fa9ec4c501585452a9a357ebe0ee61c701cc27ecf"
|
| 25 |
+
},
|
| 26 |
+
"notes": {
|
| 27 |
+
"plan.json": {
|
| 28 |
+
"args": {
|
| 29 |
+
"model": "/model",
|
| 30 |
+
"head": "/heads/RedHatAI--Qwen3.8-27B-speculator.dspark",
|
| 31 |
+
"init": null,
|
| 32 |
+
"out": "/data/step0011/train",
|
| 33 |
+
"mode": "train",
|
| 34 |
+
"replies": [
|
| 35 |
+
"/data/step0011/replies.jsonl"
|
| 36 |
+
],
|
| 37 |
+
"episodes": [
|
| 38 |
+
"/data/step0011/episodes.jsonl"
|
| 39 |
+
],
|
| 40 |
+
"eval_replies": [
|
| 41 |
+
"/data/step0011/replies.jsonl"
|
| 42 |
+
],
|
| 43 |
+
"heldout_fraction": 0.05,
|
| 44 |
+
"max_seq_tokens": 32768,
|
| 45 |
+
"block": 8,
|
| 46 |
+
"stride": 8,
|
| 47 |
+
"episode_stride": 0,
|
| 48 |
+
"max_anchors": 4096,
|
| 49 |
+
"anchors_per_update": 8192,
|
| 50 |
+
"epochs": 2.0,
|
| 51 |
+
"max_updates": 0,
|
| 52 |
+
"lr": 1e-05,
|
| 53 |
+
"min_lr": 1e-06,
|
| 54 |
+
"warmup": 10,
|
| 55 |
+
"clip": 1.0,
|
| 56 |
+
"weight_decay": 0.0,
|
| 57 |
+
"freeze": [],
|
| 58 |
+
"head_fp8": true,
|
| 59 |
+
"optimizer_device": "cpu",
|
| 60 |
+
"ce": 0.1,
|
| 61 |
+
"tv": 0.9,
|
| 62 |
+
"conf": 1.0,
|
| 63 |
+
"tv_target": "nucleus",
|
| 64 |
+
"gamma": 4.0,
|
| 65 |
+
"eval_every": 25,
|
| 66 |
+
"eval_stride": 16,
|
| 67 |
+
"eval_max_sequences": 60,
|
| 68 |
+
"patience": 3,
|
| 69 |
+
"min_gain": 0.002,
|
| 70 |
+
"save_every": 50,
|
| 71 |
+
"keep": 1,
|
| 72 |
+
"seed": 20261125,
|
| 73 |
+
"resume": false,
|
| 74 |
+
"device": "cuda",
|
| 75 |
+
"row_chunk": 256,
|
| 76 |
+
"anchor_chunk": 64,
|
| 77 |
+
"allow_kernel_packages": false,
|
| 78 |
+
"target_fp8": "/fp8",
|
| 79 |
+
"segment": 8192,
|
| 80 |
+
"target_dtype": "bfloat16"
|
| 81 |
+
},
|
| 82 |
+
"versions": {
|
| 83 |
+
"torch": "2.14.0+cu130",
|
| 84 |
+
"transformers": "5.22.2",
|
| 85 |
+
"safetensors": "0.8.0",
|
| 86 |
+
"kernel_packages": [],
|
| 87 |
+
"a_log": {
|
| 88 |
+
"loaded_as": {
|
| 89 |
+
"torch.bfloat16": 48
|
| 90 |
+
},
|
| 91 |
+
"restored": 48,
|
| 92 |
+
"bit_equal_to_file": true
|
| 93 |
+
},
|
| 94 |
+
"fp8_weights": {
|
| 95 |
+
"replaced": 400,
|
| 96 |
+
"skipped": 7,
|
| 97 |
+
"mean_relative_change": 0.022503346246667208,
|
| 98 |
+
"largest_relative_change": 0.02251635491847992
|
| 99 |
+
}
|
| 100 |
+
},
|
| 101 |
+
"head": {
|
| 102 |
+
"parameters": 1988431617,
|
| 103 |
+
"trainable": 1988431617,
|
| 104 |
+
"taps": [
|
| 105 |
+
4,
|
| 106 |
+
12,
|
| 107 |
+
20,
|
| 108 |
+
28,
|
| 109 |
+
36,
|
| 110 |
+
44,
|
| 111 |
+
52,
|
| 112 |
+
60
|
| 113 |
+
],
|
| 114 |
+
"window": 2048,
|
| 115 |
+
"fp8_aware": true,
|
| 116 |
+
"base_is_fp8": false
|
| 117 |
+
},
|
| 118 |
+
"data": {
|
| 119 |
+
"train": {
|
| 120 |
+
"own:lambda": {
|
| 121 |
+
"sequences": 1683,
|
| 122 |
+
"tokens": 10375899,
|
| 123 |
+
"generated": 7751811,
|
| 124 |
+
"anchors": 7750128,
|
| 125 |
+
"cut_media": 0,
|
| 126 |
+
"cut_length": 51
|
| 127 |
+
},
|
| 128 |
+
"own:swe": {
|
| 129 |
+
"sequences": 281,
|
| 130 |
+
"tokens": 835982,
|
| 131 |
+
"generated": 32052,
|
| 132 |
+
"anchors": 31771,
|
| 133 |
+
"cut_media": 0,
|
| 134 |
+
"cut_length": 0
|
| 135 |
+
},
|
| 136 |
+
"own:math": {
|
| 137 |
+
"sequences": 99,
|
| 138 |
+
"tokens": 1071888,
|
| 139 |
+
"generated": 967689,
|
| 140 |
+
"anchors": 967590,
|
| 141 |
+
"cut_media": 0,
|
| 142 |
+
"cut_length": 3
|
| 143 |
+
},
|
| 144 |
+
"gym:music": {
|
| 145 |
+
"sequences": 30,
|
| 146 |
+
"tokens": 753320,
|
| 147 |
+
"generated": 747565,
|
| 148 |
+
"anchors": 747535,
|
| 149 |
+
"cut_media": 0,
|
| 150 |
+
"cut_length": 3
|
| 151 |
+
},
|
| 152 |
+
"gym:general": {
|
| 153 |
+
"sequences": 114,
|
| 154 |
+
"tokens": 3626424,
|
| 155 |
+
"generated": 446279,
|
| 156 |
+
"anchors": 445234,
|
| 157 |
+
"cut_media": 0,
|
| 158 |
+
"cut_length": 97
|
| 159 |
+
},
|
| 160 |
+
"gym:code": {
|
| 161 |
+
"sequences": 58,
|
| 162 |
+
"tokens": 1851379,
|
| 163 |
+
"generated": 703312,
|
| 164 |
+
"anchors": 702076,
|
| 165 |
+
"cut_media": 0,
|
| 166 |
+
"cut_length": 54
|
| 167 |
+
},
|
| 168 |
+
"gym:webdev": {
|
| 169 |
+
"sequences": 29,
|
| 170 |
+
"tokens": 929781,
|
| 171 |
+
"generated": 732259,
|
| 172 |
+
"anchors": 731681,
|
| 173 |
+
"cut_media": 9,
|
| 174 |
+
"cut_length": 20
|
| 175 |
+
},
|
| 176 |
+
"gym:righttorepair": {
|
| 177 |
+
"sequences": 56,
|
| 178 |
+
"tokens": 1676735,
|
| 179 |
+
"generated": 492642,
|
| 180 |
+
"anchors": 491529,
|
| 181 |
+
"cut_media": 0,
|
| 182 |
+
"cut_length": 38
|
| 183 |
+
}
|
| 184 |
+
},
|
| 185 |
+
"heldout": {
|
| 186 |
+
"own:lambda": {
|
| 187 |
+
"sequences": 48,
|
| 188 |
+
"tokens": 230053,
|
| 189 |
+
"generated": 156042,
|
| 190 |
+
"anchors": 155994,
|
| 191 |
+
"cut_media": 0,
|
| 192 |
+
"cut_length": 0
|
| 193 |
+
},
|
| 194 |
+
"own:swe": {
|
| 195 |
+
"sequences": 7,
|
| 196 |
+
"tokens": 22602,
|
| 197 |
+
"generated": 892,
|
| 198 |
+
"anchors": 885,
|
| 199 |
+
"cut_media": 0,
|
| 200 |
+
"cut_length": 0
|
| 201 |
+
},
|
| 202 |
+
"gym:general": {
|
| 203 |
+
"sequences": 2,
|
| 204 |
+
"tokens": 63462,
|
| 205 |
+
"generated": 12993,
|
| 206 |
+
"anchors": 12971,
|
| 207 |
+
"cut_media": 0,
|
| 208 |
+
"cut_length": 1
|
| 209 |
+
},
|
| 210 |
+
"gym:righttorepair": {
|
| 211 |
+
"sequences": 2,
|
| 212 |
+
"tokens": 60343,
|
| 213 |
+
"generated": 13443,
|
| 214 |
+
"anchors": 13411,
|
| 215 |
+
"cut_media": 0,
|
| 216 |
+
"cut_length": 1
|
| 217 |
+
},
|
| 218 |
+
"gym:code": {
|
| 219 |
+
"sequences": 1,
|
| 220 |
+
"tokens": 32768,
|
| 221 |
+
"generated": 3718,
|
| 222 |
+
"anchors": 3710,
|
| 223 |
+
"cut_media": 0,
|
| 224 |
+
"cut_length": 1
|
| 225 |
+
}
|
| 226 |
+
},
|
| 227 |
+
"eval": {
|
| 228 |
+
"own:lcb": {
|
| 229 |
+
"sequences": 14,
|
| 230 |
+
"tokens": 180752,
|
| 231 |
+
"generated": 170907,
|
| 232 |
+
"anchors": 170893,
|
| 233 |
+
"cut_media": 0,
|
| 234 |
+
"cut_length": 4
|
| 235 |
+
},
|
| 236 |
+
"own:xstest": {
|
| 237 |
+
"sequences": 14,
|
| 238 |
+
"tokens": 11142,
|
| 239 |
+
"generated": 10283,
|
| 240 |
+
"anchors": 10269,
|
| 241 |
+
"cut_media": 0,
|
| 242 |
+
"cut_length": 0
|
| 243 |
+
},
|
| 244 |
+
"own:ifbench": {
|
| 245 |
+
"sequences": 15,
|
| 246 |
+
"tokens": 92178,
|
| 247 |
+
"generated": 90415,
|
| 248 |
+
"anchors": 90400,
|
| 249 |
+
"cut_media": 0,
|
| 250 |
+
"cut_length": 0
|
| 251 |
+
},
|
| 252 |
+
"own:gpqa": {
|
| 253 |
+
"sequences": 17,
|
| 254 |
+
"tokens": 202181,
|
| 255 |
+
"generated": 194659,
|
| 256 |
+
"anchors": 194642,
|
| 257 |
+
"cut_media": 0,
|
| 258 |
+
"cut_length": 2
|
| 259 |
+
}
|
| 260 |
+
},
|
| 261 |
+
"counts": {
|
| 262 |
+
"cut_length": 334,
|
| 263 |
+
"dropped_no_generated_tokens": 25,
|
| 264 |
+
"cut_media": 9
|
| 265 |
+
}
|
| 266 |
+
},
|
| 267 |
+
"updates": {
|
| 268 |
+
"per_epoch": 161,
|
| 269 |
+
"total": 322
|
| 270 |
+
}
|
| 271 |
+
},
|
| 272 |
+
"done.json": {
|
| 273 |
+
"updates": 322,
|
| 274 |
+
"of": 322,
|
| 275 |
+
"stop_reason": "all updates done",
|
| 276 |
+
"best_update": 275,
|
| 277 |
+
"best": 3.982853643681106,
|
| 278 |
+
"tokens": 41867007
|
| 279 |
+
}
|
| 280 |
+
}
|
| 281 |
+
}
|
dspark/config.json
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"DSparkDraftModel"
|
| 4 |
+
],
|
| 5 |
+
"auto_map": {
|
| 6 |
+
"": "config.DSparkSpeculatorConfig"
|
| 7 |
+
},
|
| 8 |
+
"aux_hidden_state_layer_ids": [
|
| 9 |
+
4,
|
| 10 |
+
12,
|
| 11 |
+
20,
|
| 12 |
+
28,
|
| 13 |
+
36,
|
| 14 |
+
44,
|
| 15 |
+
52,
|
| 16 |
+
60
|
| 17 |
+
],
|
| 18 |
+
"block_size": 8,
|
| 19 |
+
"confidence_head_with_markov": true,
|
| 20 |
+
"draft_vocab_size": 248320,
|
| 21 |
+
"dtype": "bfloat16",
|
| 22 |
+
"enable_confidence_head": true,
|
| 23 |
+
"markov_head_type": "vanilla",
|
| 24 |
+
"markov_rank": 256,
|
| 25 |
+
"mask_token_id": 248077,
|
| 26 |
+
"sample_from_anchor": true,
|
| 27 |
+
"sliding_window_non_causal": false,
|
| 28 |
+
"speculators_config": {
|
| 29 |
+
"algorithm": "dspark",
|
| 30 |
+
"default_proposal_method": "greedy",
|
| 31 |
+
"proposal_methods": [
|
| 32 |
+
{
|
| 33 |
+
"accept_tolerance": 0.0,
|
| 34 |
+
"proposal_type": "greedy",
|
| 35 |
+
"speculative_tokens": 8,
|
| 36 |
+
"verifier_accept_k": 1
|
| 37 |
+
}
|
| 38 |
+
],
|
| 39 |
+
"verifier": {
|
| 40 |
+
"architectures": [
|
| 41 |
+
"Qwen3_5ForConditionalGeneration"
|
| 42 |
+
],
|
| 43 |
+
"name_or_path": "Qwen/Qwen3.8-27B"
|
| 44 |
+
}
|
| 45 |
+
},
|
| 46 |
+
"speculators_model_type": "dspark",
|
| 47 |
+
"speculators_version": "0.9.0.dev28",
|
| 48 |
+
"target_hidden_size": null,
|
| 49 |
+
"tie_word_embeddings": false,
|
| 50 |
+
"transformer_layer_config": {
|
| 51 |
+
"attention_bias": false,
|
| 52 |
+
"attention_dropout": 0.0,
|
| 53 |
+
"bos_token_id": null,
|
| 54 |
+
"eos_token_id": null,
|
| 55 |
+
"head_dim": 256,
|
| 56 |
+
"hidden_act": "silu",
|
| 57 |
+
"hidden_size": 5120,
|
| 58 |
+
"initializer_range": 0.02,
|
| 59 |
+
"intermediate_size": 17408,
|
| 60 |
+
"layer_types": [
|
| 61 |
+
"sliding_attention",
|
| 62 |
+
"sliding_attention",
|
| 63 |
+
"sliding_attention",
|
| 64 |
+
"sliding_attention",
|
| 65 |
+
"sliding_attention"
|
| 66 |
+
],
|
| 67 |
+
"max_position_embeddings": 262144,
|
| 68 |
+
"max_window_layers": 28,
|
| 69 |
+
"model_type": "qwen3",
|
| 70 |
+
"num_attention_heads": 20,
|
| 71 |
+
"num_hidden_layers": 5,
|
| 72 |
+
"num_key_value_heads": 4,
|
| 73 |
+
"pad_token_id": null,
|
| 74 |
+
"rms_norm_eps": 1e-06,
|
| 75 |
+
"rope_parameters": {
|
| 76 |
+
"mrope_section": [
|
| 77 |
+
44,
|
| 78 |
+
44,
|
| 79 |
+
40
|
| 80 |
+
],
|
| 81 |
+
"partial_rotary_factor": 1.0,
|
| 82 |
+
"rope_theta": 10000000,
|
| 83 |
+
"rope_type": "default"
|
| 84 |
+
},
|
| 85 |
+
"sliding_window": 2048,
|
| 86 |
+
"tie_word_embeddings": false,
|
| 87 |
+
"use_cache": true,
|
| 88 |
+
"use_sliding_window": true,
|
| 89 |
+
"vocab_size": 248320,
|
| 90 |
+
"quantization_config": {
|
| 91 |
+
"activation_scheme": "dynamic",
|
| 92 |
+
"fmt": "e4m3",
|
| 93 |
+
"quant_method": "fp8",
|
| 94 |
+
"weight_block_size": [
|
| 95 |
+
128,
|
| 96 |
+
128
|
| 97 |
+
],
|
| 98 |
+
"modules_to_not_convert": [
|
| 99 |
+
"model.markov_head.markov_w2",
|
| 100 |
+
"markov_head.markov_w2"
|
| 101 |
+
]
|
| 102 |
+
}
|
| 103 |
+
},
|
| 104 |
+
"transformers_version": "5.16.1",
|
| 105 |
+
"quantization_config": {
|
| 106 |
+
"activation_scheme": "dynamic",
|
| 107 |
+
"fmt": "e4m3",
|
| 108 |
+
"quant_method": "fp8",
|
| 109 |
+
"weight_block_size": [
|
| 110 |
+
128,
|
| 111 |
+
128
|
| 112 |
+
],
|
| 113 |
+
"modules_to_not_convert": [
|
| 114 |
+
"model.markov_head.markov_w2",
|
| 115 |
+
"markov_head.markov_w2"
|
| 116 |
+
]
|
| 117 |
+
}
|
| 118 |
+
}
|
dspark/config.py
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Literal
|
| 2 |
+
|
| 3 |
+
from pydantic import Field
|
| 4 |
+
|
| 5 |
+
from speculators import SpeculatorModelConfig
|
| 6 |
+
from speculators.models.dflash.config import DFlashSpeculatorConfig
|
| 7 |
+
|
| 8 |
+
__all__ = [
|
| 9 |
+
"DSparkSpeculatorConfig",
|
| 10 |
+
]
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
@SpeculatorModelConfig.register("dspark")
|
| 14 |
+
class DSparkSpeculatorConfig(DFlashSpeculatorConfig):
|
| 15 |
+
"""DFlash config plus a Markov logit-bias head and a confidence head.
|
| 16 |
+
|
| 17 |
+
The Markov head lets each draft position condition on previously sampled
|
| 18 |
+
tokens within the block; the confidence head predicts the per-position
|
| 19 |
+
acceptance probability. All DFlash fields are inherited unchanged.
|
| 20 |
+
"""
|
| 21 |
+
|
| 22 |
+
speculators_model_type: Literal["dspark"] = "dspark" # type: ignore[assignment]
|
| 23 |
+
architectures: list[str] = Field(
|
| 24 |
+
default_factory=lambda: ["DSparkSpeculator"],
|
| 25 |
+
description="Model architectures that can load these weights",
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
sample_from_anchor: bool = Field(
|
| 29 |
+
default=True,
|
| 30 |
+
description=(
|
| 31 |
+
"Whether to sample from the anchor position. "
|
| 32 |
+
"False: anchor is the bonus token, only mask tokens predict "
|
| 33 |
+
"(block_size-1 speculative tokens). "
|
| 34 |
+
"True: sample from anchor and all mask positions "
|
| 35 |
+
"(block_size speculative tokens). "
|
| 36 |
+
"Default True matches DeepSeek/DeepSpec convention."
|
| 37 |
+
),
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
+
# Sequential (Markov) head.
|
| 41 |
+
markov_rank: int = Field(
|
| 42 |
+
default=256,
|
| 43 |
+
description=(
|
| 44 |
+
"Low-rank dimension of the Markov logit-bias factorization B = W1 @ W2. "
|
| 45 |
+
"Set to 0 to disable the sequential head (pure DFlash drafting)."
|
| 46 |
+
),
|
| 47 |
+
)
|
| 48 |
+
markov_head_type: Literal["vanilla", "gated", "rnn"] = Field(
|
| 49 |
+
default="vanilla",
|
| 50 |
+
description=(
|
| 51 |
+
"Sequential head variant: 'vanilla' (first-order Markov bias), 'gated' "
|
| 52 |
+
"(hidden-gated bias), or 'rnn' (recurrent state over the block)."
|
| 53 |
+
),
|
| 54 |
+
)
|
| 55 |
+
|
| 56 |
+
# Confidence head.
|
| 57 |
+
enable_confidence_head: bool = Field(
|
| 58 |
+
default=True,
|
| 59 |
+
description="Whether to attach the per-position acceptance-probability head.",
|
| 60 |
+
)
|
| 61 |
+
confidence_head_with_markov: bool = Field(
|
| 62 |
+
default=True,
|
| 63 |
+
description=(
|
| 64 |
+
"Concatenate the Markov previous-token embedding with the backbone "
|
| 65 |
+
"hidden state as the confidence-head input."
|
| 66 |
+
),
|
| 67 |
+
)
|
dspark/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1a439c748135b7b352a36c5168147d18e70356135e244c09553dbd9d64fcbe67
|
| 3 |
+
size 2115878466
|
generation_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 248044,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
248046,
|
| 6 |
+
248044
|
| 7 |
+
],
|
| 8 |
+
"pad_token_id": 248044,
|
| 9 |
+
"temperature": 1.0,
|
| 10 |
+
"top_k": 20,
|
| 11 |
+
"top_p": 0.95
|
| 12 |
+
}
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
model-part-00001.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:355e8ef5db712fc78cf66a83bb05c326327543a8656d237be9250468c630b80a
|
| 3 |
+
size 10376
|
model-part-00002.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5d38d109779e8bd1217615cbfc12c6a12bb3ccb58914334f50050f74921cb147
|
| 3 |
+
size 2542796952
|
model-part-00003.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2425df3662d1e5e51f0f6df53627c8dd33a51c99a6c50098b5aae05849f6cfef
|
| 3 |
+
size 2542796928
|
model-part-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:86c20299125a968445e3656026d3d55fcca8a8bdb6257e472eee811526de0520
|
| 3 |
+
size 895566920
|
model-part-00005.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:69a8675c1ee3d6c995f9ee22b34c4d3b42bc1ab94e15d677e09a4e40c901febc
|
| 3 |
+
size 975286640
|
model-part-00006.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8138bfce52c2ff894011a836beea56987a78bdd2d79a6d8c9c11faf9c699db5b
|
| 3 |
+
size 975286640
|
model-part-00007.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7d50194d48442c518f163953a30cee8462d142e70adb2849130a0723d773e5e5
|
| 3 |
+
size 1058200976
|
model-part-00008.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cb327577eee3f16403d74b415c28985c4c0b206d56d026bb0eb0e65d5c025cad
|
| 3 |
+
size 954332400
|
model-part-00009.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4deec02ee9bf42b75355580cefcdac95b9c817dd76335b57e6ed7b5a8cc96ed8
|
| 3 |
+
size 975286640
|
model-part-00010.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:65c6a6767917c789f3860708c3fa045dac2db2d65247b861bd761c27d5113922
|
| 3 |
+
size 953250280
|
model-part-00011.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b601b68fc5191630cccae61aea2a1228f6e89260f57307a037bf4b084686dfb6
|
| 3 |
+
size 975379568
|
model-part-00012.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ca68b23539ee66a02e41cef4d358f315df4cf3326d89d2f5e48e7258207e83ef
|
| 3 |
+
size 1059190192
|
model-part-00013.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a5dc6a27a8bf1c918712c7960b5427903460308d707e91eb0dbe64fdc0dbd56b
|
| 3 |
+
size 953250312
|
model-part-00014.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:de944ba4f3e23aeef9ac3d2ca276501bf4d1d964e8c6c6d402e801e6a7bfb872
|
| 3 |
+
size 975286664
|
model-part-00015.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3910a5ca7ddb52635862a7f96fc1443f936296f7c5abb37071a8e3105725890d
|
| 3 |
+
size 975379600
|
model-part-00016.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2740a1b30966d8bbdfe016b914569fb12f5f8fdedee483a0f84f222fef7cda5f
|
| 3 |
+
size 1037153832
|
model-part-00017.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7ead010e4a0867b3b6f7456e68ae9e4e45f6aa8cb2b73b39a63ec1422fc483e1
|
| 3 |
+
size 975286672
|
model-part-00018.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0c51e80e571d37e252a43a2ca3c227aff22cbad36f1d5028c2b29702040f4b2e
|
| 3 |
+
size 975286664
|
model-part-00019.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9c92d328c3fd6be184dd48304fc23755e420d0175a91baa2b43fc573a9e37499
|
| 3 |
+
size 1038212384
|
model-part-00020.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aca2eb2fd929013d9311874bb7ad6e4cc2fe0ae5d822def0776eb2c67e4d1cb3
|
| 3 |
+
size 974321048
|
model-part-00021.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:44a623cffda80279819ccea3d0be8f0ff392d41351baaaa2b7a166da1b366281
|
| 3 |
+
size 975286672
|
model-part-00022.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:65206f3aa08f052790196d3dd44463df481ea1426046e4af08113fb432468412
|
| 3 |
+
size 975286664
|
model-part-00023.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e0c88e58e4c9dd4e2c16f1b5ec2115b3f16557b47af1d0609979722da4162076
|
| 3 |
+
size 1058201008
|
model-part-00024.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a98fd93b3dd41b18e075ca858d25b1647b23285aa58f3d20995553fb3f710f70
|
| 3 |
+
size 954332440
|
model-part-00025.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:220e071ec484a434ca583dec6418dbc8e36aaf3f328fafc109049d07d8815a93
|
| 3 |
+
size 975286672
|
model-part-00026.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6182e25c289fc9bc205375588d63dbdd5dadfcf76b14e33d3b1e17821c4a8fa6
|
| 3 |
+
size 922769960
|
model-part-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9800e60e910ce72fd14e46e08f4aa8a871aeaf85a87373bd2c80bf11c3c37ac4
|
| 3 |
+
size 1049756992
|
model-part-00028.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:abff8dffc00cc9c33b1c06a81d7062f1d0f9fe5e20bff0c1271fc892c60594cc
|
| 3 |
+
size 1071629792
|
model-part-00029.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:85ca88f093cabd5c5fcdc5278ae150d373ed1febdbf1a1e4c3e0fb809136e6f9
|
| 3 |
+
size 922769960
|
model-part-00030.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fa177e9693cfdc86eeb4016128dc66cde03f9153dbbf366459d8626a097d123a
|
| 3 |
+
size 1049756992
|
model-part-00031.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a64428c2e4335b4952feb04746ed28e224ef8f2805658860390a0e4437a1105c
|
| 3 |
+
size 1071629792
|
model-part-00032.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d9f93d7c6fb37449a0007bc2d0ddac7ee1ed0783f5e7189cde854c9fabf39c85
|
| 3 |
+
size 922769960
|
model-part-00033.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f2c8d32bdd81f4934063f37b5919a70ef6c67e1fc218de325986feeaf7bcedd0
|
| 3 |
+
size 1049756992
|
model-part-00034.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a7cf1af2b8b087f73011364f516e2e2aed520449cff47fb396a08c9d459b5992
|
| 3 |
+
size 1071629792
|
model-part-00035.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:724e02f19e5754a69580e8d68a6ace282a6653cf90716cfbaebacb7357439e62
|
| 3 |
+
size 922769960
|
model-part-00036.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a49fda88475a3fd61223400bb25da1c0bad34682ef2cdf3c6328f7dc43fc9333
|
| 3 |
+
size 1049756992
|
model-part-00037.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:32cff9dc7952a20f7802e4fd225aa64966f4e943344b0cec2b2a4a471498d197
|
| 3 |
+
size 1071629792
|
model-part-00038.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9266155dc32cfad702bb5fd6c704fd5025728249c0b0c5336efac4d48218c4c3
|
| 3 |
+
size 922769960
|