Spanicin commited on
Commit
702ca30
1 Parent(s): dc24fb7

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. README.md +61 -0
  2. model-1.safetensors +3 -0
  3. model-2.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - merge
5
+ - mergekit
6
+ - lazymergekit
7
+ - mistralai/Mistral-7B-v0.1
8
+ - TinyLlama/TinyLlama-1.1B-Chat-v1.0
9
+ ---
10
+
11
+ # NeuralPipe-7B-slerp2
12
+
13
+ NeuralPipe-7B-slerp2 is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
14
+ * [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
15
+ * [TinyLlama/TinyLlama-1.1B-Chat-v1.0](https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0)
16
+
17
+ ## 🧩 Configuration
18
+
19
+ ```yaml
20
+ slices:
21
+ - sources:
22
+ - model: mistralai/Mistral-7B-v0.1
23
+ layer_range: [0, 32]
24
+ - model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
25
+ layer_range: [0, 32]
26
+ merge_method: slerp
27
+ base_model: mistralai/Mistral-7B-v0.1
28
+ parameters:
29
+ t:
30
+ - filter: self_attn
31
+ value: [0, 0.5, 0.3, 0.7, 1]
32
+ - filter: mlp
33
+ value: [1, 0.5, 0.7, 0.3, 0]
34
+ - value: 0.5
35
+ dtype: bfloat16
36
+ ```
37
+
38
+ ## 💻 Usage
39
+
40
+ ```python
41
+ !pip install -qU transformers accelerate
42
+
43
+ from transformers import AutoTokenizer
44
+ import transformers
45
+ import torch
46
+
47
+ model = "Spanicin/NeuralPipe-7B-slerp2"
48
+ messages = [{"role": "user", "content": "What is a large language model?"}]
49
+
50
+ tokenizer = AutoTokenizer.from_pretrained(model)
51
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
52
+ pipeline = transformers.pipeline(
53
+ "text-generation",
54
+ model=model,
55
+ torch_dtype=torch.float16,
56
+ device_map="auto",
57
+ )
58
+
59
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
60
+ print(outputs[0]["generated_text"])
61
+ ```
model-1.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:27724d56a01cf5d5fb2d80de900f8d1faa8109df317afb39362214459018b3b7
3
+ size 1889595352
model-2.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db9e55e67cf8481a69d3da85b1c0c80b31d8ea39bf4d60c191fbf95b2050196b
3
+ size 1979781416