s3nh commited on
Commit
94ab3ad
1 Parent(s): c5f0476

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +137 -0
README.md ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-sa-4.0
3
+ language:
4
+ - en
5
+ tags:
6
+ - text-generation-inference
7
+ pipeline_tag: text-generation
8
+ ---
9
+
10
+
11
+ ## Original model card
12
+
13
+ Buy me a coffee if you like this project ;)
14
+ <a href="https://www.buymeacoffee.com/s3nh"><img src="https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-1.svg" alt=""></a>
15
+
16
+ #### Description
17
+
18
+ GGML Format model files for [This project](https://huggingface.co/stabilityai/StableBeluga-7B).
19
+
20
+
21
+ It consist of k_quant quantization in every format:
22
+
23
+ -4_0
24
+ -4_1
25
+ -5_0
26
+ -5_1
27
+ -8_0
28
+
29
+
30
+ ### inference
31
+
32
+
33
+ ```python
34
+
35
+ import ctransformers
36
+
37
+ from ctransformers import AutoModelForCausalLM
38
+
39
+ model = AutoModelForCausalLM.from_pretrained(output_dir, ggml_file,
40
+ gpu_layers=32, model_type="llama")
41
+
42
+ manual_input: str = "Tell me about your last dream, please."
43
+
44
+
45
+ llm(manual_input,
46
+ max_new_tokens=256,
47
+ temperature=0.9,
48
+ top_p= 0.7)
49
+
50
+ ```
51
+
52
+
53
+
54
+ # Original model card
55
+
56
+
57
+ ## Usage
58
+
59
+ Start chatting with `Stable Beluga 7B` using the following code snippet:
60
+
61
+ ```python
62
+ import torch
63
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
64
+
65
+ tokenizer = AutoTokenizer.from_pretrained("stabilityai/StableBeluga-7B", use_fast=False)
66
+ model = AutoModelForCausalLM.from_pretrained("stabilityai/StableBeluga-7B", torch_dtype=torch.float16, low_cpu_mem_usage=True, device_map="auto")
67
+ system_prompt = "### System:\nYou are StableBeluga, an AI that follows instructions extremely well. Help as much as you can. Remember, be safe, and don't do anything illegal.\n\n"
68
+
69
+ message = "Write me a poem please"
70
+ prompt = f"{system_prompt}### User: {message}\n\n### Assistant:\n"
71
+ inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
72
+ output = model.generate(**inputs, do_sample=True, top_p=0.95, top_k=0, max_new_tokens=256)
73
+
74
+ print(tokenizer.decode(output[0], skip_special_tokens=True))
75
+ ```
76
+
77
+ Stable Beluga 7B should be used with this prompt format:
78
+ ```
79
+ ### System:
80
+ This is a system prompt, please behave and help the user.
81
+
82
+ ### User:
83
+ Your prompt here
84
+
85
+ ### Assistant:
86
+ The output of Stable Beluga 7B
87
+ ```
88
+
89
+ ## Model Details
90
+
91
+ * **Developed by**: [Stability AI](https://stability.ai/)
92
+ * **Model type**: Stable Beluga 7B is an auto-regressive language model fine-tuned on Llama2 7B.
93
+ * **Language(s)**: English
94
+ * **Library**: [HuggingFace Transformers](https://github.com/huggingface/transformers)
95
+ * **License**: Fine-tuned checkpoints (`Stable Beluga 7B`) is licensed under the [STABLE BELUGA NON-COMMERCIAL COMMUNITY LICENSE AGREEMENT](https://huggingface.co/stabilityai/StableBeluga-7B/blob/main/LICENSE.txt)
96
+ * **Contact**: For questions and comments about the model, please email `lm@stability.ai`
97
+
98
+ ### Training Dataset
99
+
100
+ ` Stable Beluga 7B` is trained on our internal Orca-style dataset
101
+
102
+ ### Training Procedure
103
+
104
+ Models are learned via supervised fine-tuning on the aforementioned datasets, trained in mixed-precision (BF16), and optimized with AdamW. We outline the following hyperparameters:
105
+
106
+ | Dataset | Batch Size | Learning Rate |Learning Rate Decay| Warm-up | Weight Decay | Betas |
107
+ |-------------------|------------|---------------|-------------------|---------|--------------|-------------|
108
+ | Orca pt1 packed | 256 | 3e-5 | Cosine to 3e-6 | 100 | 1e-6 | (0.9, 0.95) |
109
+ | Orca pt2 unpacked | 512 | 3e-5 | Cosine to 3e-6 | 100 | 1e-6 | (0.9, 0.95) |
110
+
111
+ ## Ethical Considerations and Limitations
112
+
113
+ Beluga is a new technology that carries risks with use. Testing conducted to date has been in English, and has not covered, nor could it cover all scenarios. For these reasons, as with all LLMs, Beluga's potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses to user prompts. Therefore, before deploying any applications of Beluga, developers should perform safety testing and tuning tailored to their specific applications of the model.
114
+
115
+ ## Citations
116
+
117
+ ```bibtext
118
+ @misc{touvron2023llama,
119
+ title={Llama 2: Open Foundation and Fine-Tuned Chat Models},
120
+ author={Hugo Touvron and Louis Martin and Kevin Stone and Peter Albert and Amjad Almahairi and Yasmine Babaei and Nikolay Bashlykov and Soumya Batra and Prajjwal Bhargava and Shruti Bhosale and Dan Bikel and Lukas Blecher and Cristian Canton Ferrer and Moya Chen and Guillem Cucurull and David Esiobu and Jude Fernandes and Jeremy Fu and Wenyin Fu and Brian Fuller and Cynthia Gao and Vedanuj Goswami and Naman Goyal and Anthony Hartshorn and Saghar Hosseini and Rui Hou and Hakan Inan and Marcin Kardas and Viktor Kerkez and Madian Khabsa and Isabel Kloumann and Artem Korenev and Punit Singh Koura and Marie-Anne Lachaux and Thibaut Lavril and Jenya Lee and Diana Liskovich and Yinghai Lu and Yuning Mao and Xavier Martinet and Todor Mihaylov and Pushkar Mishra and Igor Molybog and Yixin Nie and Andrew Poulton and Jeremy Reizenstein and Rashi Rungta and Kalyan Saladi and Alan Schelten and Ruan Silva and Eric Michael Smith and Ranjan Subramanian and Xiaoqing Ellen Tan and Binh Tang and Ross Taylor and Adina Williams and Jian Xiang Kuan and Puxin Xu and Zheng Yan and Iliyan Zarov and Yuchen Zhang and Angela Fan and Melanie Kambadur and Sharan Narang and Aurelien Rodriguez and Robert Stojnic and Sergey Edunov and Thomas Scialom},
121
+ year={2023},
122
+ eprint={2307.09288},
123
+ archivePrefix={arXiv},
124
+ primaryClass={cs.CL}
125
+ }
126
+ ```
127
+
128
+ ```bibtext
129
+ @misc{mukherjee2023orca,
130
+ title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
131
+ author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
132
+ year={2023},
133
+ eprint={2306.02707},
134
+ archivePrefix={arXiv},
135
+ primaryClass={cs.CL}
136
+ }
137
+ ```