Update README.md
Browse files
README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
base_model:
|
| 3 |
- openlm-research/open_llama_7b
|
| 4 |
- stabilityai/StableBeluga-7B
|
|
@@ -6,17 +7,38 @@ tags:
|
|
| 6 |
- merge
|
| 7 |
- mergekit
|
| 8 |
- lazymergekit
|
| 9 |
-
-
|
| 10 |
-
-
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
# OpenLlama-Stable-7B
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
```yaml
|
| 22 |
slices:
|
|
@@ -40,27 +62,57 @@ parameters:
|
|
| 40 |
dtype: bfloat16
|
| 41 |
```
|
| 42 |
|
| 43 |
-
##
|
| 44 |
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
|
| 53 |
-
messages = [{"role": "user", "content": "What is a large language model?"}]
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
|
|
|
|
|
|
|
|
|
| 60 |
torch_dtype=torch.float16,
|
| 61 |
-
device_map="auto"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
)
|
| 63 |
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
base_model:
|
| 4 |
- openlm-research/open_llama_7b
|
| 5 |
- stabilityai/StableBeluga-7B
|
|
|
|
| 7 |
- merge
|
| 8 |
- mergekit
|
| 9 |
- lazymergekit
|
| 10 |
+
- open_llama
|
| 11 |
+
- StableBeluga
|
| 12 |
+
- slerp
|
| 13 |
---
|
| 14 |
|
| 15 |
# OpenLlama-Stable-7B
|
| 16 |
|
| 17 |
+
This is a merge of pre-trained language models created using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing), combining the foundational capabilities of OpenLM's Open Llama with StabilityAI's StableBeluga through an efficient SLERP fusion.
|
| 18 |
+
|
| 19 |
+
## About Me
|
| 20 |
+
|
| 21 |
+
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 capabilities.
|
| 22 |
+
|
| 23 |
+
🔗 [Connect with me on LinkedIn](https://www.linkedin.com/in/david-soeiro-vuong-a28b582ba/)
|
| 24 |
+
|
| 25 |
+
## Merge Details
|
| 26 |
+
|
| 27 |
+
### Merge Method
|
| 28 |
|
| 29 |
+
This model uses SLERP (Spherical Linear Interpolation) with carefully tuned parameters to achieve optimal performance balance:
|
| 30 |
+
|
| 31 |
+
- **Attention Layers**: 0.7 interpolation value favoring StableBeluga's strong instruction-following capabilities
|
| 32 |
+
- **MLP Layers**: 0.5 interpolation value creating an equal blend for balanced reasoning
|
| 33 |
+
- **Other Parameters**: 0.6 interpolation value slightly favoring StableBeluga's refinements
|
| 34 |
+
- **Format**: bfloat16 precision for efficient memory usage
|
| 35 |
+
|
| 36 |
+
### Models Merged
|
| 37 |
+
|
| 38 |
+
* [openlm-research/open_llama_7b](https://huggingface.co/openlm-research/open_llama_7b) - An open-source reproduction of Meta's LLaMA that offers strong base capabilities
|
| 39 |
+
* [stabilityai/StableBeluga-7B](https://huggingface.co/stabilityai/StableBeluga-7B) - StabilityAI's instruction-tuned variant offering improved instruction following and coherence
|
| 40 |
+
|
| 41 |
+
### Configuration
|
| 42 |
|
| 43 |
```yaml
|
| 44 |
slices:
|
|
|
|
| 62 |
dtype: bfloat16
|
| 63 |
```
|
| 64 |
|
| 65 |
+
## Model Capabilities
|
| 66 |
|
| 67 |
+
This merge combines:
|
| 68 |
+
- Open Llama's strong foundational knowledge and reasoning
|
| 69 |
+
- StableBeluga's improved instruction following and coherence
|
| 70 |
+
- Fully open architecture with no usage restrictions
|
| 71 |
|
| 72 |
+
The resulting model provides enhanced performance on tasks requiring both strong reasoning and good instruction following, such as:
|
| 73 |
+
- Detailed explanations of complex concepts
|
| 74 |
+
- Creative writing with coherent structure
|
| 75 |
+
- Problem-solving with step-by-step reasoning
|
| 76 |
+
- Balanced factual responses with nuanced perspectives
|
| 77 |
|
| 78 |
+
## Usage
|
|
|
|
| 79 |
|
| 80 |
+
```python
|
| 81 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 82 |
+
import torch
|
| 83 |
+
|
| 84 |
+
model_id = "david-sv/OpenLlama-Stable-7B" # Replace with your actual HF username
|
| 85 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 86 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 87 |
+
model_id,
|
| 88 |
torch_dtype=torch.float16,
|
| 89 |
+
device_map="auto"
|
| 90 |
+
)
|
| 91 |
+
|
| 92 |
+
# For chat completions
|
| 93 |
+
prompt = """<human>: Explain the concept of spherical linear interpolation (SLERP) and why it's useful for merging language models.
|
| 94 |
+
|
| 95 |
+
<assistant>:"""
|
| 96 |
+
|
| 97 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 98 |
+
output = model.generate(
|
| 99 |
+
inputs["input_ids"],
|
| 100 |
+
max_new_tokens=512,
|
| 101 |
+
temperature=0.7,
|
| 102 |
+
top_p=0.9,
|
| 103 |
+
repetition_penalty=1.1
|
| 104 |
)
|
| 105 |
|
| 106 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
## Limitations
|
| 110 |
+
|
| 111 |
+
- Inherits limitations from both base models
|
| 112 |
+
- May exhibit inconsistent behavior for certain complex reasoning tasks
|
| 113 |
+
- No additional alignment or fine-tuning beyond the base models' training
|
| 114 |
+
- Model was created through parameter merging without additional training data
|
| 115 |
+
|
| 116 |
+
## License
|
| 117 |
+
|
| 118 |
+
This model is released under the Apache 2.0 license, consistent with the underlying models' licenses.
|