Views
No views yet
Stable Beluga 1 is a Llama65B model fine-tuned on an Orca style Datasetstabilityai/StableBeluga1-Delta weights alone. To obtain the correct model, one must add back the difference between LLaMA 65B and stabilityai/StableBeluga1-Delta weights. We provide the apply_delta.py script to automate the conversion, which you can run as:python3 apply_delta.py --base-model-path /path/to/model_weights/llama-65b --target-model-path StableBeluga1 --delta-path stabilityai/StableBeluga1-DeltaStable Beluga 1 using the following code snippet:1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4tokenizer = AutoTokenizer.from_pretrained("your_path_to_StableBeluga1", use_fast=False)
5model = AutoModelForCausalLM.from_pretrained("your_path_to_StableBeluga1", torch_dtype=torch.float16, low_cpu_mem_usage=True, device_map="auto")
6
7system_prompt = "Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.\n\n"
8system_prompt += "### Instruction:\nYou are Stable Beluga, an AI that follows instructions extremely well. Help as much as you can. Remember, be safe, and don't do anything illegal.\n\n"
9
10message = "Write me a poem please"
11prompt = f"{system_prompt}### Input: {message}\n\n### Response:\n"
12
13inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
14output = model.generate(**inputs, do_sample=True, top_p=0.95, top_k=0, max_new_tokens=256)
15
16print(tokenizer.decode(output[0], skip_special_tokens=True))Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
## Instruction:
This is a system prompt, please behave and help the user.
### Input:
Your prompt here
### Response:
The output of Stable Beluga 1StableBeluga1) is licensed under the Non-Commercial Creative Commons license (CC BY-NC-4.0)lm@stability.aiStable Beluga 1 is trained on our internal Orca-style dataset| Dataset | Batch Size | Learning Rate | Learning Rate Decay | Warm-up | Weight Decay | Betas |
|---|---|---|---|---|---|---|
| Orca pt1 packed | 512 | 3e-5 | Cosine to 3e-6 | 100 | 1e-6 | (0.9, 0.95) |
| Orca pt2 unpacked | 512 | 3e-5 | Cosine to 3e-6 | 100 | 1e-6 | (0.9, 0.95) |
1@misc{touvron2023llama,
2 title={LLaMA: Open and Efficient Foundation Language Models},
3 author={Hugo Touvron and Thibaut Lavril and Gautier Izacard and Xavier Martinet and Marie-Anne Lachaux and Timothée Lacroix and Baptiste Rozière and Naman Goyal and Eric Hambro and Faisal Azhar and Aurelien Rodriguez and Armand Joulin and Edouard Grave and Guillaume Lample},
4 year={2023},
5 eprint={2302.13971},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL}
8}1@misc{mukherjee2023orca,
2 title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
3 author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
4 year={2023},
5 eprint={2306.02707},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL}
8}1@misc{alpaca,
2 author = {Rohan Taori and Ishaan Gulrajani and Tianyi Zhang and Yann Dubois and Xuechen Li and Carlos Guestrin and Percy Liang and Tatsunori B. Hashimoto },
3 title = {Stanford Alpaca: An Instruction-following LLaMA model},
4 year = {2023},
5 publisher = {GitHub},
6 journal = {GitHub repository},
7 howpublished = {\url{https://github.com/tatsu-lab/stanford_alpaca}},
8}