Text Generation
Transformers
PyTorch
Safetensors
English
Chinese
llama
code
conversational
text-generation-inference
Instructions to use codefuse-ai/CodeFuse-DeepSeek-33B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use codefuse-ai/CodeFuse-DeepSeek-33B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="codefuse-ai/CodeFuse-DeepSeek-33B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("codefuse-ai/CodeFuse-DeepSeek-33B") model = AutoModelForCausalLM.from_pretrained("codefuse-ai/CodeFuse-DeepSeek-33B", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use codefuse-ai/CodeFuse-DeepSeek-33B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "codefuse-ai/CodeFuse-DeepSeek-33B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "codefuse-ai/CodeFuse-DeepSeek-33B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/codefuse-ai/CodeFuse-DeepSeek-33B
- SGLang
How to use codefuse-ai/CodeFuse-DeepSeek-33B 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 "codefuse-ai/CodeFuse-DeepSeek-33B" \ --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": "codefuse-ai/CodeFuse-DeepSeek-33B", "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 "codefuse-ai/CodeFuse-DeepSeek-33B" \ --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": "codefuse-ai/CodeFuse-DeepSeek-33B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use codefuse-ai/CodeFuse-DeepSeek-33B with Docker Model Runner:
docker model run hf.co/codefuse-ai/CodeFuse-DeepSeek-33B
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,21 +1,14 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
tasks:
|
| 6 |
-
- text-generation
|
| 7 |
---
|
| 8 |
# Model Card for CodeFuse-DeepSeek-33B
|
| 9 |
-
|
| 10 |
-
<img src="https://modelscope.cn/api/v1/models/codefuse-ai/CodeFuse-DeepSeek-33B/repo?Revision=master&FilePath=LOGO.jpg&View=true" width="800"/>
|
| 11 |
-
<p>
|
| 12 |
|
| 13 |
[[中文]](#chinese) [[English]](#english)
|
| 14 |
|
| 15 |
-
|
| 16 |
-
```bash
|
| 17 |
-
git clone https://www.modelscope.cn/codefuse-ai/CodeFuse-DeepSeek-33B.git
|
| 18 |
-
```
|
| 19 |
|
| 20 |
<a id="english"></a>
|
| 21 |
|
|
@@ -27,7 +20,7 @@ CodeFuse-DeepSeek-33B is a 33B Code-LLM finetuned by QLoRA on multiple code-rela
|
|
| 27 |
|
| 28 |
## News and Updates
|
| 29 |
|
| 30 |
-
🔥🔥🔥 2024-01-12 CodeFuse-DeepSeek-33B has been released,
|
| 31 |
|
| 32 |
🔥🔥 2023-11-10 CodeFuse-CodeGeeX2-6B has been released, achieving a pass@1 (greedy decoding) score of 45.12% on HumanEval, which is a 9.22% increase compared to CodeGeeX2 35.9%.
|
| 33 |
|
|
@@ -39,7 +32,7 @@ CodeFuse-DeepSeek-33B is a 33B Code-LLM finetuned by QLoRA on multiple code-rela
|
|
| 39 |
|
| 40 |
🔥🔥🔥 2023-09-26 We are pleased to announce the release of the [4-bit quantized version](https://modelscope.cn/models/codefuse-ai/CodeFuse-CodeLlama-34B-4bits/summary) of [CodeFuse-CodeLlama-34B](https://modelscope.cn/models/codefuse-ai/CodeFuse-CodeLlama-34B/summary). Despite the quantization process, the model still achieves a remarkable 73.8% accuracy (greedy decoding) on the HumanEval pass@1 metric.
|
| 41 |
|
| 42 |
-
🔥🔥🔥 2023-09-11 [CodeFuse-CodeLlama34B](https://modelscope.cn/models/codefuse-ai/CodeFuse-CodeLlama-34B/summary) has
|
| 43 |
|
| 44 |
<br>
|
| 45 |
|
|
@@ -133,10 +126,10 @@ In this format, the system section is optional and the conversation can be eithe
|
|
| 133 |
|
| 134 |
```python
|
| 135 |
import torch
|
| 136 |
-
from
|
| 137 |
|
| 138 |
def load_model_tokenizer(model_path):
|
| 139 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
| 140 |
tokenizer.eos_token = "<|end▁of▁sentence|>"
|
| 141 |
tokenizer.pad_token = "<|end▁of▁sentence|>"
|
| 142 |
tokenizer.eos_token_id = tokenizer.convert_tokens_to_ids(tokenizer.eos_token)
|
|
@@ -295,10 +288,10 @@ User prompt...
|
|
| 295 |
|
| 296 |
```python
|
| 297 |
import torch
|
| 298 |
-
from
|
| 299 |
|
| 300 |
def load_model_tokenizer(model_path):
|
| 301 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
| 302 |
tokenizer.eos_token = "<|end▁of▁sentence|>"
|
| 303 |
tokenizer.pad_token = "<|end▁of▁sentence|>"
|
| 304 |
tokenizer.eos_token_id = tokenizer.convert_tokens_to_ids(tokenizer.eos_token)
|
|
|
|
| 1 |
---
|
| 2 |
+
license: other
|
| 3 |
+
tasks:
|
| 4 |
+
- code-generation
|
|
|
|
|
|
|
| 5 |
---
|
| 6 |
# Model Card for CodeFuse-DeepSeek-33B
|
| 7 |
+

|
|
|
|
|
|
|
| 8 |
|
| 9 |
[[中文]](#chinese) [[English]](#english)
|
| 10 |
|
| 11 |
+
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
<a id="english"></a>
|
| 14 |
|
|
|
|
| 20 |
|
| 21 |
## News and Updates
|
| 22 |
|
| 23 |
+
🔥🔥🔥 2024-01-12 CodeFuse-DeepSeek-33B has been released, achieving a pass@1 (greedy decoding) score of 78.65% on HumanEval.
|
| 24 |
|
| 25 |
🔥🔥 2023-11-10 CodeFuse-CodeGeeX2-6B has been released, achieving a pass@1 (greedy decoding) score of 45.12% on HumanEval, which is a 9.22% increase compared to CodeGeeX2 35.9%.
|
| 26 |
|
|
|
|
| 32 |
|
| 33 |
🔥🔥🔥 2023-09-26 We are pleased to announce the release of the [4-bit quantized version](https://modelscope.cn/models/codefuse-ai/CodeFuse-CodeLlama-34B-4bits/summary) of [CodeFuse-CodeLlama-34B](https://modelscope.cn/models/codefuse-ai/CodeFuse-CodeLlama-34B/summary). Despite the quantization process, the model still achieves a remarkable 73.8% accuracy (greedy decoding) on the HumanEval pass@1 metric.
|
| 34 |
|
| 35 |
+
🔥🔥🔥 2023-09-11 [CodeFuse-CodeLlama34B](https://modelscope.cn/models/codefuse-ai/CodeFuse-CodeLlama-34B/summary) has achieved 74.4% of pass@1 (greedy decoding) on HumanEval, which is SOTA results for openspurced LLMs at present.
|
| 36 |
|
| 37 |
<br>
|
| 38 |
|
|
|
|
| 126 |
|
| 127 |
```python
|
| 128 |
import torch
|
| 129 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
|
| 130 |
|
| 131 |
def load_model_tokenizer(model_path):
|
| 132 |
+
tokenizer = AutoTokenizer.from_pretrained("codefuse-ai/CodeFuse-DeepSeek-33B", trust_remote_code=True, use_fast=False, legacy=False)
|
| 133 |
tokenizer.eos_token = "<|end▁of▁sentence|>"
|
| 134 |
tokenizer.pad_token = "<|end▁of▁sentence|>"
|
| 135 |
tokenizer.eos_token_id = tokenizer.convert_tokens_to_ids(tokenizer.eos_token)
|
|
|
|
| 288 |
|
| 289 |
```python
|
| 290 |
import torch
|
| 291 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
|
| 292 |
|
| 293 |
def load_model_tokenizer(model_path):
|
| 294 |
+
tokenizer = AutoTokenizer.from_pretrained("codefuse-ai/CodeFuse-DeepSeek-33B", trust_remote_code=True, use_fast=False, legacy=False)
|
| 295 |
tokenizer.eos_token = "<|end▁of▁sentence|>"
|
| 296 |
tokenizer.pad_token = "<|end▁of▁sentence|>"
|
| 297 |
tokenizer.eos_token_id = tokenizer.convert_tokens_to_ids(tokenizer.eos_token)
|