Instructions to use SeerAttention/SeerAttention-DeepSeek-R1-Distill-Llama-70B-AttnGates with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SeerAttention/SeerAttention-DeepSeek-R1-Distill-Llama-70B-AttnGates with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SeerAttention/SeerAttention-DeepSeek-R1-Distill-Llama-70B-AttnGates")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SeerAttention/SeerAttention-DeepSeek-R1-Distill-Llama-70B-AttnGates") model = AutoModelForCausalLM.from_pretrained("SeerAttention/SeerAttention-DeepSeek-R1-Distill-Llama-70B-AttnGates") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SeerAttention/SeerAttention-DeepSeek-R1-Distill-Llama-70B-AttnGates with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SeerAttention/SeerAttention-DeepSeek-R1-Distill-Llama-70B-AttnGates" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SeerAttention/SeerAttention-DeepSeek-R1-Distill-Llama-70B-AttnGates", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SeerAttention/SeerAttention-DeepSeek-R1-Distill-Llama-70B-AttnGates
- SGLang
How to use SeerAttention/SeerAttention-DeepSeek-R1-Distill-Llama-70B-AttnGates 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 "SeerAttention/SeerAttention-DeepSeek-R1-Distill-Llama-70B-AttnGates" \ --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": "SeerAttention/SeerAttention-DeepSeek-R1-Distill-Llama-70B-AttnGates", "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 "SeerAttention/SeerAttention-DeepSeek-R1-Distill-Llama-70B-AttnGates" \ --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": "SeerAttention/SeerAttention-DeepSeek-R1-Distill-Llama-70B-AttnGates", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use SeerAttention/SeerAttention-DeepSeek-R1-Distill-Llama-70B-AttnGates with Docker Model Runner:
docker model run hf.co/SeerAttention/SeerAttention-DeepSeek-R1-Distill-Llama-70B-AttnGates
SeerAttention-DeepSeek-R1-Distill-Llama-70B-AttnGates
This repo only contains the AttnGates' weights for deepseek-ai/DeepSeek-R1-Distill-Llama-70B.
SeerAttention introduces learnable AttnGate modules to accelerate the computationally intensive prefill stage of long-context large language models (LLMs) via dynamic block-level sparsity. The AttnGates are trained in a parameter-efficient self-distillation framework, where they learn to mimic the 2D max-pooled attention patterns of the original frozen model, preserving its integrity while avoiding costly retraining. During inference, these gates generate block-sparse binary masks by applying threshold/TopK to their learned soft scores, enabling efficient computation through a custom block-sparse FlashAttention kernel.
Original Github Repo https://github.com/microsoft/SeerAttention.
- Downloads last month
- 3
Model tree for SeerAttention/SeerAttention-DeepSeek-R1-Distill-Llama-70B-AttnGates
Base model
deepseek-ai/DeepSeek-R1-Distill-Llama-70B