dohrisalim commited on
Commit
650f81d
·
verified ·
1 Parent(s): 314cbb2

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +62 -0
README.md ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - NTQAI/Nxcode-CQ-7B-orpo
4
+ - Qwen/CodeQwen1.5-7B-Chat
5
+ tags:
6
+ - merge
7
+ - mergekit
8
+ - NTQAI/Nxcode-CQ-7B-orpo
9
+ - Qwen/CodeQwen1.5-7B-Chat
10
+ ---
11
+
12
+ # Code-7B-slerp
13
+
14
+ Code-7B-slerp is a merge of the following models Mergekit:
15
+ * [NTQAI/Nxcode-CQ-7B-orpo](https://huggingface.co/NTQAI/Nxcode-CQ-7B-orpo)
16
+ * [Qwen/CodeQwen1.5-7B-Chat](https://huggingface.co/Qwen/CodeQwen1.5-7B-Chat)
17
+
18
+ ## 🧩 Configuration
19
+
20
+ ```yaml
21
+ slices:
22
+ - sources:
23
+ - model: NTQAI/Nxcode-CQ-7B-orpo
24
+ layer_range: [0, 32]
25
+ - model: Qwen/CodeQwen1.5-7B-Chat
26
+ layer_range: [0, 32]
27
+ merge_method: slerp
28
+ base_model: NTQAI/Nxcode-CQ-7B-orpo
29
+ parameters:
30
+ t:
31
+ - filter: self_attn
32
+ value: [0, 0.5, 0.3, 0.7, 1]
33
+ - filter: mlp
34
+ value: [1, 0.5, 0.7, 0.3, 0]
35
+ - value: 0.5
36
+ dtype: bfloat16
37
+ ```
38
+
39
+ ## 💻 Usage
40
+
41
+ ```python
42
+ !pip install -qU transformers accelerate
43
+
44
+ from transformers import AutoTokenizer
45
+ import transformers
46
+ import torch
47
+
48
+ model = "dohrisalim/Code-7B-slerp"
49
+ messages = [{"role": "user", "content": "How to print hello world in python?"}]
50
+
51
+ tokenizer = AutoTokenizer.from_pretrained(model)
52
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
53
+ pipeline = transformers.pipeline(
54
+ "text-generation",
55
+ model=model,
56
+ torch_dtype=torch.float16,
57
+ device_map="auto",
58
+ )
59
+
60
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
61
+ print(outputs[0]["generated_text"])
62
+ ```