Text Generation
Transformers
Safetensors
deepseek_v2
fp8
vllm
conversational
custom_code
text-generation-inference
Instructions to use RedHatAI/DeepSeek-Coder-V2-Lite-Base-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RedHatAI/DeepSeek-Coder-V2-Lite-Base-FP8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RedHatAI/DeepSeek-Coder-V2-Lite-Base-FP8", trust_remote_code=True) 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("RedHatAI/DeepSeek-Coder-V2-Lite-Base-FP8", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("RedHatAI/DeepSeek-Coder-V2-Lite-Base-FP8", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use RedHatAI/DeepSeek-Coder-V2-Lite-Base-FP8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RedHatAI/DeepSeek-Coder-V2-Lite-Base-FP8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RedHatAI/DeepSeek-Coder-V2-Lite-Base-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/RedHatAI/DeepSeek-Coder-V2-Lite-Base-FP8
- SGLang
How to use RedHatAI/DeepSeek-Coder-V2-Lite-Base-FP8 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 "RedHatAI/DeepSeek-Coder-V2-Lite-Base-FP8" \ --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": "RedHatAI/DeepSeek-Coder-V2-Lite-Base-FP8", "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 "RedHatAI/DeepSeek-Coder-V2-Lite-Base-FP8" \ --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": "RedHatAI/DeepSeek-Coder-V2-Lite-Base-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use RedHatAI/DeepSeek-Coder-V2-Lite-Base-FP8 with Docker Model Runner:
docker model run hf.co/RedHatAI/DeepSeek-Coder-V2-Lite-Base-FP8
Update README.md
Browse files
README.md
CHANGED
|
@@ -21,7 +21,7 @@ tags:
|
|
| 21 |
|
| 22 |
Quantized version of [DeepSeek-Coder-V2-Lite-Base](deepseek-ai/DeepSeek-Coder-V2-Lite-Base).
|
| 23 |
<!-- It achieves an average score of 73.19 on the [OpenLLM](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard) benchmark (version 1), whereas the unquantized model achieves 73.48. -->
|
| 24 |
-
It achieves an average score of 68.68 on the [HumanEval](https://github.com/openai/human-eval?tab=readme-ov-file) benchmark, whereas the unquantized model achieves 68.25.
|
| 25 |
|
| 26 |
### Model Optimizations
|
| 27 |
|
|
@@ -100,7 +100,7 @@ model.save_quantized(quantized_model_dir)
|
|
| 100 |
|
| 101 |
## Evaluation
|
| 102 |
|
| 103 |
-
The model was evaluated on the [HumanEval](https://github.com/openai/human-eval?tab=readme-ov-file) benchmark with the [Neural Magic fork](https://github.com/neuralmagic/evalplus) of the [EvalPlus implementation of HumanEval](https://github.com/evalplus/evalplus) and the [vLLM](https://docs.vllm.ai/en/stable/) engine, using the following command:
|
| 104 |
```
|
| 105 |
python codegen/generate.py --model neuralmagic/DeepSeek-Coder-V2-Lite-Base-FP8 --temperature 0.2 --n_samples 50 --resume --root ~ --dataset humaneval
|
| 106 |
python evalplus/sanitize.py ~/humaneval/neuralmagic--DeepSeek-Coder-V2-Lite-Base-FP8_vllm_temp_0.2
|
|
@@ -109,7 +109,7 @@ evalplus.evaluate --dataset humaneval --samples ~/humaneval/neuralmagic--DeepSee
|
|
| 109 |
|
| 110 |
### Accuracy
|
| 111 |
|
| 112 |
-
####
|
| 113 |
<table>
|
| 114 |
<tr>
|
| 115 |
<td><strong>Benchmark</strong>
|
|
|
|
| 21 |
|
| 22 |
Quantized version of [DeepSeek-Coder-V2-Lite-Base](deepseek-ai/DeepSeek-Coder-V2-Lite-Base).
|
| 23 |
<!-- It achieves an average score of 73.19 on the [OpenLLM](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard) benchmark (version 1), whereas the unquantized model achieves 73.48. -->
|
| 24 |
+
It achieves an average score of 68.68 on the [HumanEval+](https://github.com/openai/human-eval?tab=readme-ov-file) benchmark, whereas the unquantized model achieves 68.25.
|
| 25 |
|
| 26 |
### Model Optimizations
|
| 27 |
|
|
|
|
| 100 |
|
| 101 |
## Evaluation
|
| 102 |
|
| 103 |
+
The model was evaluated on the [HumanEval+](https://github.com/openai/human-eval?tab=readme-ov-file) benchmark with the [Neural Magic fork](https://github.com/neuralmagic/evalplus) of the [EvalPlus implementation of HumanEval+](https://github.com/evalplus/evalplus) and the [vLLM](https://docs.vllm.ai/en/stable/) engine, using the following command:
|
| 104 |
```
|
| 105 |
python codegen/generate.py --model neuralmagic/DeepSeek-Coder-V2-Lite-Base-FP8 --temperature 0.2 --n_samples 50 --resume --root ~ --dataset humaneval
|
| 106 |
python evalplus/sanitize.py ~/humaneval/neuralmagic--DeepSeek-Coder-V2-Lite-Base-FP8_vllm_temp_0.2
|
|
|
|
| 109 |
|
| 110 |
### Accuracy
|
| 111 |
|
| 112 |
+
#### HumanEval+ evaluation scores
|
| 113 |
<table>
|
| 114 |
<tr>
|
| 115 |
<td><strong>Benchmark</strong>
|