DeepSeek Texte
DeepSeek Texte
Introduction
The world of code intelligence has seen a significant breakthrough with the introduction
of DeepSeek-Coder-V2, an open-source Mixture-of-Experts (MoE) code language model
that rivals closed-source giants like GPT-4 Turbo. This powerful model is a further pre-
trained version of DeepSeek-V2, enriched with an additional 6 trillion tokens. This
extensive training enhances its capabilities in coding and mathematical reasoning while
maintaining robust performance in general language tasks.
Context Length
The model also boasts an extended context length, increasing from 16K to 128K. This
allows for more comprehensive and nuanced understanding and generation of code,
accommodating larger and more complex coding projects.
Model Availability
Using DeepSeek-Coder-V2
You can interact with DeepSeek-Coder-V2 on its official chat website or use the OpenAI-
compatible API provided by DeepSeek Platform. The API offers a pay-as-you-go pricing
model, making it accessible for various users.
Local Deployment
For those looking to run DeepSeek-Coder-V2 locally, the following examples illustrate
how to use the model with Hugging Face’s Transformers library:
Code Completion
tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-Coder-V2-Lite-
Base", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-Coder-V2-
Lite-Base", trust_remote_code=True, torch_dtype=torch.bfloat16).cuda()
Code Insertion
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-Coder-V2-Lite-
Base", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-Coder-V2-
Lite-Base", trust_remote_code=True, torch_dtype=torch.bfloat16).cuda()
Chat Completion
tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-Coder-V2-Lite-
Instruct", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-Coder-V2-
Lite-Instruct", trust_remote_code=True, torch_dtype=torch.bfloat16).cuda()