Text Generation
Transformers
PyTorch
Safetensors
llama
axolotl
Generated from Trainer
text-generation-inference
Instructions to use CodeGPTPlus/deepseek-coder-1.3b-typescript with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CodeGPTPlus/deepseek-coder-1.3b-typescript with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CodeGPTPlus/deepseek-coder-1.3b-typescript")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("CodeGPTPlus/deepseek-coder-1.3b-typescript") model = AutoModelForCausalLM.from_pretrained("CodeGPTPlus/deepseek-coder-1.3b-typescript") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CodeGPTPlus/deepseek-coder-1.3b-typescript with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CodeGPTPlus/deepseek-coder-1.3b-typescript" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CodeGPTPlus/deepseek-coder-1.3b-typescript", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/CodeGPTPlus/deepseek-coder-1.3b-typescript
- SGLang
How to use CodeGPTPlus/deepseek-coder-1.3b-typescript 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 "CodeGPTPlus/deepseek-coder-1.3b-typescript" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CodeGPTPlus/deepseek-coder-1.3b-typescript", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "CodeGPTPlus/deepseek-coder-1.3b-typescript" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CodeGPTPlus/deepseek-coder-1.3b-typescript", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use CodeGPTPlus/deepseek-coder-1.3b-typescript with Docker Model Runner:
docker model run hf.co/CodeGPTPlus/deepseek-coder-1.3b-typescript
update README.md more details
#2
by DanielSan7 - opened
README.md
CHANGED
|
@@ -109,10 +109,59 @@ special_tokens:
|
|
| 109 |
|
| 110 |
# deepseek-coder-1.3b-typescript
|
| 111 |
|
| 112 |
-
|
|
|
|
|
|
|
|
|
|
| 113 |
It achieves the following results on the evaluation set:
|
| 114 |
- Loss: 0.7681
|
| 115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
## Training procedure
|
| 117 |
|
| 118 |
### Training hyperparameters
|
|
|
|
| 109 |
|
| 110 |
# deepseek-coder-1.3b-typescript
|
| 111 |
|
| 112 |
+
CodeGPTPlus/deepseek-coder-1.3b-typescript, emerges as a fine-tuned iteration of [deepseek-ai/deepseek-coder-1.3b-base](https://huggingface.co/deepseek-ai/deepseek-coder-1.3b-base), meticulously crafted by the CodeGPT team to excel in generating expert code in TypeScript. With specific fine-tuning for TypeScript and a dataset of 0.5B tokens, this model excels in producing precise and efficient solutions in this programming language.
|
| 113 |
+
The 16K window size and an additional fill-in-the-middle task are employed to deliver project-level code completion.
|
| 114 |
+
This new model stands as the ideal choice for those seeking a specialized code generator for TypeScript, backed by the expertise of the CodeGPT team.
|
| 115 |
+
|
| 116 |
It achieves the following results on the evaluation set:
|
| 117 |
- Loss: 0.7681
|
| 118 |
|
| 119 |
+
**Model Developers** CodeGPT Team
|
| 120 |
+
**Variations** 1.3B
|
| 121 |
+
**Input** Models input text only.
|
| 122 |
+
**Output** Models generate text only.
|
| 123 |
+
|
| 124 |
+
## How to Use
|
| 125 |
+
This model is for completion purposes only. Here give some examples of how to use the model.
|
| 126 |
+
|
| 127 |
+
#### Running the model on a GPU
|
| 128 |
+
```python
|
| 129 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 130 |
+
tokenizer = AutoTokenizer.from_pretrained("CodeGPTPlus/deepseek-coder-1.3b-typescript",
|
| 131 |
+
trust_remote_code=True)
|
| 132 |
+
model = AutoModelForCausalLM.from_pretrained("CodeGPTPlus/deepseek-coder-1.3b-typescript",
|
| 133 |
+
trust_remote_code=True).cuda()
|
| 134 |
+
|
| 135 |
+
input_text = """<|fim▁begin|>function quickSort(arr: number[]): number[] {
|
| 136 |
+
if (arr.length <= 1) {
|
| 137 |
+
return arr;
|
| 138 |
+
}
|
| 139 |
+
const pivot = arr[0];
|
| 140 |
+
const left = [];
|
| 141 |
+
const right = [];
|
| 142 |
+
<|fim▁hole|>
|
| 143 |
+
return [...quickSort(left), pivot, ...quickSort(right)];
|
| 144 |
+
}<|fim▁end|>"""
|
| 145 |
+
|
| 146 |
+
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
|
| 147 |
+
outputs = model.generate(**inputs, max_length=256)
|
| 148 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 149 |
+
```
|
| 150 |
+
|
| 151 |
+
### Fill In the Middle (FIM)
|
| 152 |
+
```python
|
| 153 |
+
<|fim▁begin|>function quickSort(arr: number[]): number[] {
|
| 154 |
+
if (arr.length <= 1) {
|
| 155 |
+
return arr;
|
| 156 |
+
}
|
| 157 |
+
const pivot = arr[0];
|
| 158 |
+
const left = [];
|
| 159 |
+
const right = [];
|
| 160 |
+
<|fim▁hole|>
|
| 161 |
+
return [...quickSort(left), pivot, ...quickSort(right)];
|
| 162 |
+
}<|fim▁end|>
|
| 163 |
+
```
|
| 164 |
+
|
| 165 |
## Training procedure
|
| 166 |
|
| 167 |
### Training hyperparameters
|