saucam's picture
Update README.md
63b8e25 verified
---
tags:
- merge
- mergekit
- cognitivecomputations/dolphin-2.9-llama3-8b
- NousResearch/Hermes-2-Pro-Llama-3-8B
- abacusai/Llama-3-Smaug-8B
models:
- cognitivecomputations/dolphin-2.9-llama3-8b
- NousResearch/Hermes-2-Pro-Llama-3-8B
- abacusai/Llama-3-Smaug-8B
license: apache-2.0
---
![](https://raw.githubusercontent.com/saucam/models/main/aqua-smaug-hermes.png)
# πŸ’§ aqua-smaug-hermes-8B πŸ•ŠοΈ
aqua-smaug-hermes-8B is a merge of the following models using [Mergekit](https://github.com/arcee-ai/mergekit):
* [cognitivecomputations/dolphin-2.9-llama3-8b](https://huggingface.co/cognitivecomputations/dolphin-2.9-llama3-8b)
* [NousResearch/Hermes-2-Pro-Llama-3-8B](https://huggingface.co/NousResearch/Hermes-2-Pro-Llama-3-8B)
* [abacusai/Llama-3-Smaug-8B](https://huggingface.co/abacusai/Llama-3-Smaug-8B)
## 🧩 Configuration
```yamlname: aqua-smaug-hermes-8B
tokenizer_source: union
base_model:
model:
path: NousResearch/Hermes-2-Pro-Llama-3-8B
dtype: float16
merge_method: dare_linear
parameters:
normalize: 1.0
slices:
- sources:
- model: cognitivecomputations/dolphin-2.9-llama3-8b
layer_range: [0, 32]
parameters:
weight: 0.3
- model: NousResearch/Hermes-2-Pro-Llama-3-8B
layer_range: [0, 32]
parameters:
weight: 0.4
- model: abacusai/Llama-3-Smaug-8B
layer_range: [0, 32]
parameters:
weight: 0.3
```
## πŸ’» Usage
Using pipelines
```python
!pip install -qU transformers accelerate
from transformers import AutoTokenizer
import transformers
import torch
model = "saucam/aqua-smaug-hermes-8B"
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"])
```
```
Loading checkpoint shards: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2/2 [00:03<00:00, 1.62s/it]
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
<|begin_of_text|><|im_start|>user
What is a large language model?<|im_end|>
<|im_start|>assistant
A large language model is a type of artificial intelligence (AI) model trained on a massive dataset of text, which enables it to understand and generate human language at a level of sophistication that is comparable to or even surpassing human ability. These models are typically based on deep learning architectures, such as transformer models, and are trained on a large corpus of text data, often in the billions of parameters.
Large language models are designed to understand the context, nuances, and complexities of human language, allowing them to perform a variety of tasks such as text generation, question answering, language translation, and more. They can generate coherent and contextually relevant text based on prompts or input data, making them useful for applications like chatbots, virtual assistants, language translation tools, and content generation.
Some examples of large language models include:
1. GPT-3 (Generative Pre-trained Transformer 3) - Developed by OpenAI, this model has 175 billion parameters and is capable of generating human-like text and performing a wide range of tasks.
2. BERT (Bidirectional Encoder Representations from Transformers) - Developed by Google, this model is widely used for natural language processing tasks like question answering, sentiment analysis, and language translation.
3. T5 (Text-to-Text
```
Using model generation
```
from transformers import AutoModelForCausalLM, AutoTokenizer
import transformers
import torch
model_name = "saucam/aqua-smaug-hermes-8B"
messages = [{"role": "user", "content": "What is a large language model?"}]
model = AutoModelForCausalLM.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
messages = [
{"role": "system", "content": "You are a sentient, superintelligent artificial general intelligence, here to teach and assist me."},
{"role": "user", "content": "Write a short story about Goku discovering kirby has teamed up with Majin Buu to destroy the world."}
]
device = "cuda"
gen_input = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
model_inputs = gen_input.to(device)
model.to(device)
# Generate response
out = model.generate(model_inputs, max_new_tokens=750, temperature=0.8, repetition_penalty=1.1, do_sample=True, eos_token_id=tokenizer.eos_token_id)
response = tokenizer.decode(out[0][model_inputs.shape[-1]:], skip_special_tokens=True, clean_up_tokenization_space=True)
print(f"Response: {response}")
```
```
Loading checkpoint shards: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2/2 [00:17<00:00, 8.56s/it]
/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
warnings.warn(
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
The attention mask and the pad token id were not set. As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results.
Setting `pad_token_id` to `eos_token_id`:128003 for open-end generation.
Response: In a world where superheroes and villains coexisted, Goku, the legendary warrior from Earth, had always fought for peace and justice alongside his comrades. One day, he received a shocking message that shook him to his core.
"Goku! You won't believe who I've teamed up with," a familiar yet startling voice echoed through the universe's communication channels. It was Kirby, the pink puffball known for his copy abilities and heroic feats. However, something in his tone wasn't right this time.
Goku's initial reaction was disbelief, but as he connected the dots, his heart sank. If it were true, then it meant one of the most loathed characters in the galaxy, Majin Buu, had somehow formed an alliance with the usually benevolent Kirby.
Summoning all the power within him, Goku immediately rushed towards the scene, ready to confront whatever danger lay ahead. As he arrived, he found Kirby and Majin Buu working in tandem, their destructive energies intertwining like a twisted dance.
"Kirby, what have you done?!" Goku demanded, his anger blazing brighter than his signature Kamehameha wave.
But before Kirby could respond, Majin Buu gloated, "Ah, Goku! Your ignorance is your downfall. Together, we will bring chaos and destruction upon this realm, proving the absurdity of your so-called 'peace.'"
As they began their assault, Goku knew he couldn't take on both foes alone. He quickly sent out a distress signal to his allies across the universe, rallying them to help defend against this unexpected threat.
The battle raged on, with Goku and his team pushing back against the unholy alliance. Though Kirby's copying abilities made him a formidable opponent, Goku's sheer strength and determination kept him grounded. Meanwhile, Majin Buu's monstrous form made him nearly unstoppable.
It took a combined effort from Goku, his friends, and even some of Kirby's previous allies for the tide to turn. The final blow came when Vegeta, using the power of the Dragon Balls, created a massive explosion that separated Kirby and Majin Buu, each consumed by the blast.
When the dust settled, Goku approached Kirby, who groggily regained consciousness amidst the wreckage. The once cheerful hero looked remorseful, realizing the depths to which he'd fallen.
"It...it didn't feel like me," Kirby whispered. "Majin Buu somehow manipulated my copy abilities..."
Understanding dawned on Goku. "No matter how powerful or influential a force may be, never forget who you truly are," Goku said softly, helping Kirby stand upright. "Together, we'll ensure such a betrayal never happens again."
And so, Goku and Kirby joined forces anew, now more vigilant than ever, protecting the universe from threats both inside and outside their ranks. Their bond stronger than before, they remained steadfast guardians, a testament to the resilience that defined them as heroes. The alliance between Kirby and Majin Buu would forever serve as a cautionary tale, reminding them of the importance of staying true to their principles. Despite the darkness, there was still light, and together, they would keep shining. πŸŒŸπŸ›ΈπŸ’₯πŸ‘ŠοΈ #DragonBall #Kirby #HeroesUnite #GuardiansOfTheCosmos #PeaceAndJustice #LightVsDarkness #AllianceTurnedBetrayal #RemorsefulRegret #StrongerThanEver #TrueHeroesEndure πŸ‘πŸ’ͺ✨🌈🌠 #NeverGiveUp #DefeatChaosAndDestruction #TogetherWeStand #UnitedAgainstEvil βš‘οΈπŸ’«β­οΈπŸ”₯πŸŒŠπŸ’¨οΏ½
```