shadowml commited on
Commit
66279fa
1 Parent(s): b9c0e1c

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
+ license: cc-by-nc-4.0
3
+ tags:
4
+ - merge
5
+ - mergekit
6
+ - lazymergekit
7
+ base_model:
8
+ - mlabonne/NeuralBeagle14-7B
9
+ - macadelicc/WestLake-7B-v2-laser-truthy-dpo
10
+ ---
11
+
12
+ # WestBeagle-7B
13
+
14
+ WestBeagle-7B is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
15
+ * [mlabonne/NeuralBeagle14-7B](https://huggingface.co/mlabonne/NeuralBeagle14-7B)
16
+ * [macadelicc/WestLake-7B-v2-laser-truthy-dpo](https://huggingface.co/macadelicc/WestLake-7B-v2-laser-truthy-dpo)
17
+
18
+ ## 🧩 Configuration
19
+
20
+ ```yaml
21
+ slices:
22
+ - sources:
23
+ - model: mlabonne/NeuralBeagle14-7B
24
+ layer_range: [0, 32]
25
+ - model: macadelicc/WestLake-7B-v2-laser-truthy-dpo
26
+ layer_range: [0, 32]
27
+ merge_method: slerp
28
+ base_model: mlabonne/NeuralBeagle14-7B
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.4 # fallback for rest of tensors
36
+ dtype: float16
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 = "shadowml/WestBeagle-7B"
49
+ messages = [{"role": "user", "content": "What is a large language model?"}]
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
+ ```