Text Generation
Transformers
Safetensors
dots_dsa
custom_code
sparse-attention
mixture-of-experts
indexcache
conversational
Instructions to use fxmeng/DSV2-Lite-IndexCache-Sparse-1250 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fxmeng/DSV2-Lite-IndexCache-Sparse-1250 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fxmeng/DSV2-Lite-IndexCache-Sparse-1250", 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("fxmeng/DSV2-Lite-IndexCache-Sparse-1250", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use fxmeng/DSV2-Lite-IndexCache-Sparse-1250 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fxmeng/DSV2-Lite-IndexCache-Sparse-1250" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fxmeng/DSV2-Lite-IndexCache-Sparse-1250", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/fxmeng/DSV2-Lite-IndexCache-Sparse-1250
- SGLang
How to use fxmeng/DSV2-Lite-IndexCache-Sparse-1250 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 "fxmeng/DSV2-Lite-IndexCache-Sparse-1250" \ --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": "fxmeng/DSV2-Lite-IndexCache-Sparse-1250", "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 "fxmeng/DSV2-Lite-IndexCache-Sparse-1250" \ --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": "fxmeng/DSV2-Lite-IndexCache-Sparse-1250", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use fxmeng/DSV2-Lite-IndexCache-Sparse-1250 with Docker Model Runner:
docker model run hf.co/fxmeng/DSV2-Lite-IndexCache-Sparse-1250
Download validation.json from fxmeng/DSV2-Lite-IndexCache-Sparse-1250: direct link, hf CLI and curl.
- Browser
- Download file 4.19 kB
-
https://huggingface.co/fxmeng/DSV2-Lite-IndexCache-Sparse-1250/resolve/main/validation.json
- Command line
-
hf download hf://fxmeng/DSV2-Lite-IndexCache-Sparse-1250/validation.json
-
curl -L -o validation.json https://huggingface.co/fxmeng/DSV2-Lite-IndexCache-Sparse-1250/resolve/main/validation.json
4.19 kB
| { | |
| "method": "indexcache", | |
| "num_tensors": 5336, | |
| "num_indexer_tensors": 45, | |
| "assignments": [ | |
| { | |
| "layer": 0, | |
| "role": "group_leader", | |
| "leader": 0, | |
| "offset": 0, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 1, | |
| "role": "shared", | |
| "leader": 0, | |
| "offset": 1, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 2, | |
| "role": "shared", | |
| "leader": 0, | |
| "offset": 2, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 3, | |
| "role": "group_leader", | |
| "leader": 3, | |
| "offset": 0, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 4, | |
| "role": "shared", | |
| "leader": 3, | |
| "offset": 1, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 5, | |
| "role": "shared", | |
| "leader": 3, | |
| "offset": 2, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 6, | |
| "role": "group_leader", | |
| "leader": 6, | |
| "offset": 0, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 7, | |
| "role": "shared", | |
| "leader": 6, | |
| "offset": 1, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 8, | |
| "role": "shared", | |
| "leader": 6, | |
| "offset": 2, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 9, | |
| "role": "group_leader", | |
| "leader": 9, | |
| "offset": 0, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 10, | |
| "role": "shared", | |
| "leader": 9, | |
| "offset": 1, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 11, | |
| "role": "shared", | |
| "leader": 9, | |
| "offset": 2, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 12, | |
| "role": "group_leader", | |
| "leader": 12, | |
| "offset": 0, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 13, | |
| "role": "shared", | |
| "leader": 12, | |
| "offset": 1, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 14, | |
| "role": "shared", | |
| "leader": 12, | |
| "offset": 2, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 15, | |
| "role": "group_leader", | |
| "leader": 15, | |
| "offset": 0, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 16, | |
| "role": "shared", | |
| "leader": 15, | |
| "offset": 1, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 17, | |
| "role": "shared", | |
| "leader": 15, | |
| "offset": 2, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 18, | |
| "role": "group_leader", | |
| "leader": 18, | |
| "offset": 0, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 19, | |
| "role": "shared", | |
| "leader": 18, | |
| "offset": 1, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 20, | |
| "role": "shared", | |
| "leader": 18, | |
| "offset": 2, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 21, | |
| "role": "group_leader", | |
| "leader": 21, | |
| "offset": 0, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 22, | |
| "role": "shared", | |
| "leader": 21, | |
| "offset": 1, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 23, | |
| "role": "shared", | |
| "leader": 21, | |
| "offset": 2, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 24, | |
| "role": "group_leader", | |
| "leader": 24, | |
| "offset": 0, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 25, | |
| "role": "shared", | |
| "leader": 24, | |
| "offset": 1, | |
| "group_size": 3 | |
| }, | |
| { | |
| "layer": 26, | |
| "role": "shared", | |
| "leader": 24, | |
| "offset": 2, | |
| "group_size": 3 | |
| } | |
| ], | |
| "all_tensor_shapes_match": true, | |
| "loading_info": { | |
| "missing_keys": [], | |
| "unexpected_keys": [], | |
| "mismatched_keys": [], | |
| "error_msgs": [] | |
| }, | |
| "device": "cuda:6", | |
| "decoder_cpu_offload": true, | |
| "cache_last_logit_max_abs_diff": 0.1875, | |
| "cache_last_logit_mean_abs_diff": 0.028124965727329254, | |
| "generation": "The capital of France is Paris, and the official language is French", | |
| "sparse_forward_length": 2057, | |
| "sparse_topk": 2048, | |
| "runtime_sha256": "712e109ef9d472dc4416def5601296c4f0bf6420f0dd8f7eacf634e6f2825460", | |
| "seconds": 213.86, | |
| "unit_tests_passed": 20, | |
| "unit_subtests_passed": 4, | |
| "all_exported_tensors_finite": true, | |
| "safetensors_index_consistent": true, | |
| "checkpoint_iteration": 1250, | |
| "validation_note": "GPU inference used decoder CPU offload because shared GPUs lacked free memory for all weights. Cache logit max-absolute BF16 tolerance: 0.5." | |
| } | |