Update README.md
Browse files
README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
---
|
|
|
2 |
base_model:
|
3 |
- OpenPipe/mistral-ft-optimized-1218
|
4 |
- mlabonne/NeuralHermes-2.5-Mistral-7B
|
@@ -6,18 +7,31 @@ tags:
|
|
6 |
- merge
|
7 |
- mergekit
|
8 |
- lazymergekit
|
9 |
-
-
|
10 |
-
-
|
11 |
---
|
|
|
|
|
|
|
12 |
|
13 |
-
|
|
|
14 |
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
* [OpenPipe/mistral-ft-optimized-1218](https://huggingface.co/OpenPipe/mistral-ft-optimized-1218)
|
17 |
* [mlabonne/NeuralHermes-2.5-Mistral-7B](https://huggingface.co/mlabonne/NeuralHermes-2.5-Mistral-7B)
|
18 |
|
19 |
-
|
20 |
-
|
21 |
```yaml
|
22 |
slices:
|
23 |
- sources:
|
@@ -34,30 +48,4 @@ parameters:
|
|
34 |
- filter: mlp
|
35 |
value: [1, 0.5, 0.7, 0.3, 0]
|
36 |
- value: 0.5
|
37 |
-
dtype: bfloat16
|
38 |
-
```
|
39 |
-
|
40 |
-
## 💻 Usage
|
41 |
-
|
42 |
-
```python
|
43 |
-
!pip install -qU transformers accelerate
|
44 |
-
|
45 |
-
from transformers import AutoTokenizer
|
46 |
-
import transformers
|
47 |
-
import torch
|
48 |
-
|
49 |
-
model = "Davidsv/NeuralPipe-7B-slerp"
|
50 |
-
messages = [{"role": "user", "content": "What is a large language model?"}]
|
51 |
-
|
52 |
-
tokenizer = AutoTokenizer.from_pretrained(model)
|
53 |
-
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
54 |
-
pipeline = transformers.pipeline(
|
55 |
-
"text-generation",
|
56 |
-
model=model,
|
57 |
-
torch_dtype=torch.float16,
|
58 |
-
device_map="auto",
|
59 |
-
)
|
60 |
-
|
61 |
-
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
62 |
-
print(outputs[0]["generated_text"])
|
63 |
-
```
|
|
|
1 |
---
|
2 |
+
license: apache-2.0
|
3 |
base_model:
|
4 |
- OpenPipe/mistral-ft-optimized-1218
|
5 |
- mlabonne/NeuralHermes-2.5-Mistral-7B
|
|
|
7 |
- merge
|
8 |
- mergekit
|
9 |
- lazymergekit
|
10 |
+
- mistral
|
11 |
+
- optimized
|
12 |
---
|
13 |
+
# NeuralPipe-7B-slerp (3B Parameters)
|
14 |
+
|
15 |
+
This is an optimized merge of pre-trained language models created using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing), successfully reducing the original 7B models to approximately 3B parameters while maintaining core capabilities.
|
16 |
|
17 |
+
## About Me
|
18 |
+
I'm David Soeiro-Vuong, a third-year Computer Science student working as an apprentice at TW3 Partners, a company specialized in Generative AI. Passionate about artificial intelligence and language models optimization, I focus on creating efficient model merges that balance performance and resource usage.
|
19 |
|
20 |
+
🔗 [Connect with me on LinkedIn](https://www.linkedin.com/in/david-soeiro-vuong-a28b582ba/)
|
21 |
+
|
22 |
+
## Model Size Optimization
|
23 |
+
The reduction from 7B to 3B parameters was achieved through:
|
24 |
+
- Layer reduction from 32 to 12 layers
|
25 |
+
- Conversion to bfloat16 format (half precision)
|
26 |
+
- Selective layer range implementation
|
27 |
+
- SLERP merge method optimization
|
28 |
+
|
29 |
+
## Merge Details
|
30 |
+
### Models Merged
|
31 |
* [OpenPipe/mistral-ft-optimized-1218](https://huggingface.co/OpenPipe/mistral-ft-optimized-1218)
|
32 |
* [mlabonne/NeuralHermes-2.5-Mistral-7B](https://huggingface.co/mlabonne/NeuralHermes-2.5-Mistral-7B)
|
33 |
|
34 |
+
### Configuration
|
|
|
35 |
```yaml
|
36 |
slices:
|
37 |
- sources:
|
|
|
48 |
- filter: mlp
|
49 |
value: [1, 0.5, 0.7, 0.3, 0]
|
50 |
- value: 0.5
|
51 |
+
dtype: bfloat16
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|