File size: 4,215 Bytes
0981240
d9996cf
 
 
 
 
 
0981240
31a0bd5
0981240
d9996cf
26645aa
0981240
31a0bd5
d9996cf
31a0bd5
d9996cf
9c0e7df
d9996cf
 
 
 
 
 
 
 
 
0096d97
d9996cf
0096d97
d9996cf
 
 
 
0981240
d9996cf
 
 
0981240
d9996cf
2e207a9
 
0981240
d9996cf
0981240
d9996cf
 
 
 
0981240
d9996cf
0981240
d9996cf
0981240
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d9996cf
 
0981240
d9996cf
 
 
 
 
 
 
 
 
 
31a0bd5
d9996cf
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
---
license: other
license_name: qwen
license_link: https://huggingface.co/Qwen/Qwen2.5-72B-Instruct/blob/main/LICENSE
language:
- en
pipeline_tag: text-generation
base_model:
- Qwen/Qwen2.5-72B-Instruct
tags:
- chat
---

# Qwen2.5-95B-Instruct

Qwen2.5-95B-Instruct is a [Qwen/Qwen2.5-72B-Instruct](https://huggingface.co/Qwen/Qwen2.5-72B-Instruct) self-merge made with [MergeKit](https://github.com/arcee-ai/mergekit/tree/main).

The layer ranges chosen for this merge were inspired by a rough estimate of the layer similarity analysis of [ssmits/Falcon2-5.5B-multilingual](https://huggingface.co/ssmits/Falcon2-5.5B-multilingual). Layer similarity analysis involves examining the outputs of different layers in a neural network to determine how similar or different they are. This technique can help identify which layers contribute most significantly to the model's performance. In the context of the Falcon-11B model, layer similarity analysis across multiple languages revealed that the first half of the layers were more important for maintaining performance. Additionally, this analysis can be used to more rigidly slice and add extra layers for optimal Next Token Prediction, allowing for possibly a model architecture that's more creative and powerful.

- [alpindale/goliath-120b](https://huggingface.co/alpindale/goliath-120b)
- [cognitivecomputations/MegaDolphin-120b](https://huggingface.co/cognitivecomputations/MegaDolphin-120b)
- [mlabonne/Meta-Llama-3-120B-Instruct](https://huggingface.co/mlabonne/Meta-Llama-3-120B-Instruct)

Special thanks to [Eric Hartford](https://huggingface.co/ehartford) for both inspiring and evaluating the original model, to [Charles Goddard](https://huggingface.co/chargoddard) for creating MergeKit, and to [Mathieu Labonne](https://huggingface.co/mlabonne) for creating the Meta-Llama-3-120B-Instruct model that served as the main inspiration for this merge.

## 🔍 Applications

This model is probably good for creative writing tasks. It uses the Qwen chat template with a default context window of 128K.

The model could be quite creative and maybe even better than the 72B model at some tasks.

## ⚡ Quantized models

To be quantized.

* **GGUF**: [Link to GGUF model]
* **EXL2**: [Link to EXL2 model]
* **mlx**: [Link to mlx model]

## 🏆 Evaluation
This model has yet to be thoroughly evaluated. It is expected to excel in creative writing and more but may have limitations in other tasks.
Use it with caution and don't expect it to outperform state-of-the-art models outside of specific creative use cases.

Once the model is created and tested, this section will be updated with:

* Links to evaluation threads on social media platforms
* Examples of the model's performance in creative writing tasks
* Comparisons with other large language models in various applications
* Community feedback and use cases

We encourage users to share their experiences and evaluations to help build a comprehensive understanding of the model's capabilities and limitations.

## 🧩 Configuration

```yaml
slices:
- sources:
  - layer_range: [0, 10]
    model: Qwen/Qwen2.5-72B-Instruct
- sources:
  - layer_range: [5, 15]
    model: Qwen/Qwen2.5-72B-Instruct
- sources:
  - layer_range: [10, 20]
    model: Qwen/Qwen2.5-72B-Instruct
- sources:
  - layer_range: [15, 25]
    model: Qwen/Qwen2.5-72B-Instruct
- sources:
  - layer_range: [20, 30]
    model: Qwen/Qwen2.5-72B-Instruct
- sources:
  - layer_range: [25, 80]
    model: Qwen/Qwen2.5-72B-Instruct
dtype: bfloat16
merge_method: passthrough
```

## 💻 Usage

```python
!pip install -qU transformers accelerate

from transformers import AutoTokenizer
import transformers
import torch

model = "ssmits/Qwen2.5-95B-Instruct"
messages = [{"role": "user", "content": "What is a large language model?"}]

tokenizer = AutoTokenizer.from_pretrained(model)
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
pipeline = transformers.pipeline(
    "text-generation",
    model=model,
    torch_dtype=torch.float16,
    device_map="auto",
)

outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])