duyntnet commited on
Commit
0ec51f9
1 Parent(s): ccbefd1

Upload README.md

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