Text Generation
Transformers
Safetensors
English
qwen2
optd
on-policy-distillation
transition-distillation
reasoning
text-generation-inference
conversational
Instructions to use ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain") model = AutoModelForCausalLM.from_pretrained("ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain
- SGLang
How to use ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain 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 "ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain" \ --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": "ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain", "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 "ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain" \ --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": "ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain with Docker Model Runner:
docker model run hf.co/ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain
Download checksums.json from ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain: direct link, hf CLI and curl.
- Browser
- Download file 929 Bytes
-
https://huggingface.co/ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain/resolve/main/checksums.json
- Command line
-
hf download hf://ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain/checksums.json
-
curl -L -o checksums.json https://huggingface.co/ModalityDance/OPTD-DeepSeek-R1-Distill-Qwen-1.5B-ThreeDomain/resolve/main/checksums.json
929 Bytes
| { | |
| "model.safetensors": { | |
| "sha256": "efcf937510a9cf35781d3a3dde2ef2c64714553a9219b4b8d6f554cb4baabcba", | |
| "bytes": 3554214752 | |
| }, | |
| "config.json": { | |
| "sha256": "1497f6f8a20c475239f119d7aab4d502160ddd31d0565c08c749583741c5f83e", | |
| "bytes": 1362 | |
| }, | |
| "tokenizer_config.json": { | |
| "sha256": "55edc67ee25d8e0d4b7a13036ee61cdb880b49db4398533cc6a29710d1790ade", | |
| "bytes": 4490 | |
| }, | |
| "chat_template.jinja": { | |
| "sha256": "56a1447ad31926fdc21fb07e56e5642bd9c850c4f52d8c8af7bbe5f079a84f5f", | |
| "bytes": 2246 | |
| }, | |
| "special_tokens_map.json": { | |
| "sha256": "59cda48bbe8bab9d61ffb410e6e3c07b6d98bff73cee7c88ff8b51f95f21ab1c", | |
| "bytes": 485 | |
| }, | |
| "tokenizer.json": { | |
| "sha256": "e20ddafc659ba90242154b55275402edeca0715e5dbb30f56815a4ce081f4893", | |
| "bytes": 11422778 | |
| }, | |
| "generation_config.json": { | |
| "sha256": "994ffcc2da754604dd754028c2bb0ea5ac52747f206d73f62c72543a6ee96664", | |
| "bytes": 181 | |
| } | |
| } | |