Text Generation
Transformers
Safetensors
qwen3
feature-extraction
dflash2
speculative-decoding
draft-model
sglang
conversational
custom_code
text-generation-inference
Instructions to use HYHPING2023/checkpoint-draft-dflash2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HYHPING2023/checkpoint-draft-dflash2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HYHPING2023/checkpoint-draft-dflash2", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("HYHPING2023/checkpoint-draft-dflash2", trust_remote_code=True) model = AutoModel.from_pretrained("HYHPING2023/checkpoint-draft-dflash2", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HYHPING2023/checkpoint-draft-dflash2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HYHPING2023/checkpoint-draft-dflash2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HYHPING2023/checkpoint-draft-dflash2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HYHPING2023/checkpoint-draft-dflash2
- SGLang
How to use HYHPING2023/checkpoint-draft-dflash2 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 "HYHPING2023/checkpoint-draft-dflash2" \ --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": "HYHPING2023/checkpoint-draft-dflash2", "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 "HYHPING2023/checkpoint-draft-dflash2" \ --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": "HYHPING2023/checkpoint-draft-dflash2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use HYHPING2023/checkpoint-draft-dflash2 with Docker Model Runner:
docker model run hf.co/HYHPING2023/checkpoint-draft-dflash2
DFlash2 draft (epoch_3_step_35300) for Qwen3.5-35B-A3B VCLR3 target: 5-layer draft + two-tap dynamic convs + top-16 candidate selector, block 8
edfa72c verified | { | |
| "transformers_version": "5.8.1", | |
| "architectures": [ | |
| "DFlash2DraftModel" | |
| ], | |
| "output_hidden_states": false, | |
| "return_dict": true, | |
| "dtype": "bfloat16", | |
| "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": 248320, | |
| "hidden_size": 2048, | |
| "intermediate_size": 8192, | |
| "num_hidden_layers": 5, | |
| "num_attention_heads": 16, | |
| "num_key_value_heads": 2, | |
| "head_dim": 256, | |
| "hidden_act": "silu", | |
| "max_position_embeddings": 262144, | |
| "initializer_range": 0.02, | |
| "rms_norm_eps": 1e-06, | |
| "use_cache": true, | |
| "tie_word_embeddings": false, | |
| "rope_parameters": { | |
| "rope_theta": 1000000, | |
| "rope_type": "default" | |
| }, | |
| "attention_bias": false, | |
| "use_sliding_window": false, | |
| "sliding_window": null, | |
| "max_window_layers": 5, | |
| "layer_types": [ | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention" | |
| ], | |
| "attention_dropout": 0.0, | |
| "pad_token_id": null, | |
| "bos_token_id": null, | |
| "eos_token_id": 248044, | |
| "_name_or_path": "output/dflash2/draft_config.json", | |
| "model_type": "qwen3", | |
| "auto_map": { | |
| "AutoModel": "dflash.DFlash2DraftModel" | |
| }, | |
| "block_size": 8, | |
| "dflash_config": { | |
| "mask_token_id": 248043, | |
| "target_layer_ids": [ | |
| 1, | |
| 10, | |
| 19, | |
| 28, | |
| 37 | |
| ], | |
| "conv_kernel_size": 2, | |
| "conv_group_size": 16, | |
| "selector_rank": 256, | |
| "selector_top_k": 16 | |
| }, | |
| "num_target_layers": 40, | |
| "output_attentions": false | |
| } |