Instructions to use deepseek-ai/deepseek-coder-33b-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use deepseek-ai/deepseek-coder-33b-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="deepseek-ai/deepseek-coder-33b-instruct") 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("deepseek-ai/deepseek-coder-33b-instruct") model = AutoModelForCausalLM.from_pretrained("deepseek-ai/deepseek-coder-33b-instruct", 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 deepseek-ai/deepseek-coder-33b-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "deepseek-ai/deepseek-coder-33b-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "deepseek-ai/deepseek-coder-33b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/deepseek-ai/deepseek-coder-33b-instruct
- SGLang
How to use deepseek-ai/deepseek-coder-33b-instruct 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 "deepseek-ai/deepseek-coder-33b-instruct" \ --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": "deepseek-ai/deepseek-coder-33b-instruct", "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 "deepseek-ai/deepseek-coder-33b-instruct" \ --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": "deepseek-ai/deepseek-coder-33b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use deepseek-ai/deepseek-coder-33b-instruct with Docker Model Runner:
docker model run hf.co/deepseek-ai/deepseek-coder-33b-instruct
Commit History
-
Updated the sample code to avoid warning
Verified signatureUserWarning: `do_sample` is set to `False`. However, `top_p` is set to `0.95` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `top_p`.4a82596
-
Adding `safetensors` variant of this model (#24)
Verified signature- Adding `safetensors` variant of this model (7e7e24c9d736ca46a44fe65204c41840b9bc3b3f) Co-authored-by: Calvinn Ng <Calvinnncy97@users.noreply.huggingface.co>61dc97b
-
Update README.md
Verified signature6f09197
-
Update README.md
c89cc88
-
Update README.md
c7ea557
-
Update tokenizer_config.json
ea15d17
-
Update tokenizer_config.json
90ca43c
-
Update tokenizer_config.json
e3460f2
-
Update tokenizer_config.json
623a105
-
Update tokenizer_config.json (#5)
- Update tokenizer_config.json (ceff240ffc285b2e26bd26661d223d12d8580349) Co-authored-by: Tom Jobbins <TheBloke@users.noreply.huggingface.co>83bb1ca -
Update generation_config.json
604e746 -
Update config.json
f517a38 -
Upload LICENSE
d979ddd -
Delete LICENSE-CODE
89835f7 -
Delete LICENSE-MODEL
fdfb502 -
Delete LICENSE
4cec643 -
Upload 2 files
35e7098 -
Update README.md
8180f45
-
Update tokenizer_config.json
1dcb075 -
Update README.md
f627034
-
Update README.md
9725382
-
Update README.md
f3dd46b -
Update README.md
1f1729b
-
Update tokenizer_config.json
4f7a80a -
fix bugs
0911d90 -
upload models
4e3839a -
Update README.md
3053526 -
initial commit
2a1cbc2