Upload README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
tags:
|
| 7 |
+
- gguf
|
| 8 |
+
- imatrix
|
| 9 |
+
- deepseek-ai
|
| 10 |
+
- deepseek-coder-1.3b-instruct
|
| 11 |
+
---
|
| 12 |
+
Quantizations of https://huggingface.co/deepseek-ai/deepseek-coder-1.3b-instruct
|
| 13 |
+
|
| 14 |
+
# From original readme
|
| 15 |
+
|
| 16 |
+
### 3. How to Use
|
| 17 |
+
Here give some examples of how to use our model.
|
| 18 |
+
#### Chat Model Inference
|
| 19 |
+
```python
|
| 20 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 21 |
+
tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/deepseek-coder-1.3b-instruct", trust_remote_code=True)
|
| 22 |
+
model = AutoModelForCausalLM.from_pretrained("deepseek-ai/deepseek-coder-1.3b-instruct", trust_remote_code=True, torch_dtype=torch.bfloat16).cuda()
|
| 23 |
+
messages=[
|
| 24 |
+
{ 'role': 'user', 'content': "write a quick sort algorithm in python."}
|
| 25 |
+
]
|
| 26 |
+
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
|
| 27 |
+
# tokenizer.eos_token_id is the id of <|EOT|> token
|
| 28 |
+
outputs = model.generate(inputs, max_new_tokens=512, do_sample=False, top_k=50, top_p=0.95, num_return_sequences=1, eos_token_id=tokenizer.eos_token_id)
|
| 29 |
+
print(tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True))
|
| 30 |
+
```
|