Text Generation
GGUF
7 languages
causal-lm
ggml
quantized
q2_k
q3_k_m
q4_k_m
q5_k_m
q6_k
q8_0
12 papers
afrideva commited on
Commit
ef1627d
1 Parent(s): 50ff379

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +171 -0
README.md ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: stabilityai/stablelm-2-1_6b
3
+ datasets:
4
+ - tiiuae/falcon-refinedweb
5
+ - togethercomputer/RedPajama-Data-1T
6
+ - uonlp/CulturaX
7
+ - CarperAI/pilev2-dev
8
+ - bigcode/starcoderdata
9
+ - DataProvenanceInitiative/Commercially-Verified-Licenses
10
+ inference: false
11
+ language:
12
+ - en
13
+ - de
14
+ - es
15
+ - fr
16
+ - it
17
+ - nl
18
+ - pt
19
+ license: other
20
+ model_creator: stabilityai
21
+ model_name: stablelm-2-1_6b
22
+ pipeline_tag: text-generation
23
+ quantized_by: afrideva
24
+ tags:
25
+ - causal-lm
26
+ - gguf
27
+ - ggml
28
+ - quantized
29
+ - q2_k
30
+ - q3_k_m
31
+ - q4_k_m
32
+ - q5_k_m
33
+ - q6_k
34
+ - q8_0
35
+ ---
36
+ # stabilityai/stablelm-2-1_6b-GGUF
37
+
38
+ Quantized GGUF model files for [stablelm-2-1_6b](https://huggingface.co/stabilityai/stablelm-2-1_6b) from [stabilityai](https://huggingface.co/stabilityai)
39
+
40
+
41
+ | Name | Quant method | Size |
42
+ | ---- | ---- | ---- |
43
+ | [stablelm-2-1_6b.fp16.gguf](https://huggingface.co/afrideva/stablelm-2-1_6b-GGUF/resolve/main/stablelm-2-1_6b.fp16.gguf) | fp16 | 3.29 GB |
44
+ | [stablelm-2-1_6b.q2_k.gguf](https://huggingface.co/afrideva/stablelm-2-1_6b-GGUF/resolve/main/stablelm-2-1_6b.q2_k.gguf) | q2_k | 694.16 MB |
45
+ | [stablelm-2-1_6b.q3_k_m.gguf](https://huggingface.co/afrideva/stablelm-2-1_6b-GGUF/resolve/main/stablelm-2-1_6b.q3_k_m.gguf) | q3_k_m | 857.71 MB |
46
+ | [stablelm-2-1_6b.q4_k_m.gguf](https://huggingface.co/afrideva/stablelm-2-1_6b-GGUF/resolve/main/stablelm-2-1_6b.q4_k_m.gguf) | q4_k_m | 1.03 GB |
47
+ | [stablelm-2-1_6b.q5_k_m.gguf](https://huggingface.co/afrideva/stablelm-2-1_6b-GGUF/resolve/main/stablelm-2-1_6b.q5_k_m.gguf) | q5_k_m | 1.19 GB |
48
+ | [stablelm-2-1_6b.q6_k.gguf](https://huggingface.co/afrideva/stablelm-2-1_6b-GGUF/resolve/main/stablelm-2-1_6b.q6_k.gguf) | q6_k | 1.35 GB |
49
+ | [stablelm-2-1_6b.q8_0.gguf](https://huggingface.co/afrideva/stablelm-2-1_6b-GGUF/resolve/main/stablelm-2-1_6b.q8_0.gguf) | q8_0 | 1.75 GB |
50
+
51
+
52
+
53
+ ## Original Model Card:
54
+ # `Stable LM 2 1.6B`
55
+
56
+ ## Model Description
57
+
58
+ `Stable LM 2 1.6B` is a 1.6 billion parameter decoder-only language model pre-trained on 2 trillion tokens of diverse multilingual and code datasets for two epochs.
59
+
60
+ ## Usage
61
+
62
+ Get started generating text with `Stable LM 2 1.6B` by using the following code snippet:
63
+
64
+ ```python
65
+ from transformers import AutoModelForCausalLM, AutoTokenizer
66
+ tokenizer = AutoTokenizer.from_pretrained("stabilityai/stablelm-2-1_6b", trust_remote_code=True)
67
+ model = AutoModelForCausalLM.from_pretrained(
68
+ "stabilityai/stablelm-2-1_6b",
69
+ trust_remote_code=True,
70
+ torch_dtype="auto",
71
+ )
72
+ model.cuda()
73
+ inputs = tokenizer("The weather is always wonderful", return_tensors="pt").to(model.device)
74
+ tokens = model.generate(
75
+ **inputs,
76
+ max_new_tokens=64,
77
+ temperature=0.70,
78
+ top_p=0.95,
79
+ do_sample=True,
80
+ )
81
+ print(tokenizer.decode(tokens[0], skip_special_tokens=True))
82
+ ```
83
+
84
+ ### Run with Flash Attention 2 ⚡️
85
+
86
+ <details>
87
+ <summary> Click to expand </summary>
88
+
89
+ ```python
90
+ from transformers import AutoModelForCausalLM, AutoTokenizer
91
+ tokenizer = AutoTokenizer.from_pretrained("stabilityai/stablelm-2-1_6b", trust_remote_code=True)
92
+ model = AutoModelForCausalLM.from_pretrained(
93
+ "stabilityai/stablelm-2-1_6b",
94
+ trust_remote_code=True,
95
+ torch_dtype="auto",
96
+ attn_implementation="flash_attention_2",
97
+ )
98
+ model.cuda()
99
+ inputs = tokenizer("The weather is always wonderful", return_tensors="pt").to(model.device)
100
+ tokens = model.generate(
101
+ **inputs,
102
+ max_new_tokens=64,
103
+ temperature=0.70,
104
+ top_p=0.95,
105
+ do_sample=True,
106
+ )
107
+ print(tokenizer.decode(tokens[0], skip_special_tokens=True))
108
+ ```
109
+
110
+ </details>
111
+
112
+
113
+ ## Model Details
114
+
115
+ * **Developed by**: [Stability AI](https://stability.ai/)
116
+ * **Model type**: `Stable LM 2 1.6B` models are auto-regressive language models based on the transformer decoder architecture.
117
+ * **Language(s)**: English
118
+ * **Library**: [GPT-NeoX](https://github.com/EleutherAI/gpt-neox)
119
+ * **License**: [Stability AI Non-Commercial Research Community License](https://huggingface.co/stabilityai/stablelm-2-1_6b/blob/main/LICENSE). If you'd like to use this model for commercial products or purposes, please contact us [here](https://stability.ai/membership) to learn more.
120
+ * **Contact**: For questions and comments about the model, please email `lm@stability.ai`
121
+
122
+ ### Model Architecture
123
+
124
+ The model is a decoder-only transformer similar to the LLaMA ([Touvron et al., 2023](https://arxiv.org/abs/2307.09288)) architecture with the following modifications:
125
+
126
+ | Parameters | Hidden Size | Layers | Heads | Sequence Length |
127
+ |----------------|-------------|--------|-------|-----------------|
128
+ | 1,644,417,024 | 2048 | 24 | 32 | 4096 |
129
+
130
+ * **Position Embeddings**: Rotary Position Embeddings ([Su et al., 2021](https://arxiv.org/abs/2104.09864)) applied to the first 25% of head embedding dimensions for improved throughput following [Black et al. (2022)](https://arxiv.org/pdf/2204.06745.pdf).
131
+ * **Normalization**: LayerNorm ([Ba et al., 2016](https://arxiv.org/abs/1607.06450)) with learned bias terms as opposed to RMSNorm ([Zhang & Sennrich, 2019](https://arxiv.org/abs/1910.07467)).
132
+ * **Biases**: We remove all bias terms from the model except for attention Q,K,V projections ([Bai et al., 2023](https://arxiv.org/abs/2309.16609)).
133
+ * **Tokenizer**: We use Arcade100k, a BPE tokenizer extended from OpenAI's [`tiktoken.cl100k_base`](https://github.com/openai/tiktoken). We split digits into individual tokens following findings by [Liu & Low (2023)](https://arxiv.org/abs/2305.14201).
134
+
135
+ ## Training
136
+
137
+ ### Training Dataset
138
+
139
+ The dataset is comprised of a filtered mixture of open-source large-scale datasets available on the [HuggingFace Hub](https://huggingface.co/datasets): Falcon RefinedWeb extract ([Penedo et al., 2023](https://huggingface.co/datasets/tiiuae/falcon-refinedweb)), RedPajama-Data ([Together Computer., 2023](https://github.com/togethercomputer/RedPajama-Data)) and The Pile ([Gao et al., 2020](https://arxiv.org/abs/2101.00027)) both without the *Books3* subset, and StarCoder ([Li et al., 2023](https://arxiv.org/abs/2305.06161)). We further supplement our training with multi-lingual data from CulturaX ([Nguyen et al., 2023](https://arxiv.org/abs/2309.09400)) and, in particular, from its OSCAR corpora, as well as restructured data in the style of [Yuan & Liu (2022)](https://arxiv.org/abs/2206.11147).
140
+
141
+ * Given the large amount of web data, we recommend fine-tuning the base `Stable LM 2 1.6B` for your downstream tasks.
142
+
143
+ ### Training Procedure
144
+
145
+ The model is pre-trained on the aforementioned datasets in `bfloat16` precision, optimized with AdamW, and trained using the NeoX tokenizer with a vocabulary size of 100,352. We outline the complete hyperparameters choices in the project's [GitHub repository - config*](https://github.com/Stability-AI/StableLM/blob/main/configs/stablelm-2-1.6b.yml). The final checkpoint of pre-training, before cooldown, is provided in the `global_step420000` [branch](https://huggingface.co/stabilityai/stablelm-2-1_6b/blob/global_step420000/README.md).
146
+
147
+ ### Training Infrastructure
148
+
149
+ * **Hardware**: `Stable LM 2 1.6B` was trained on the Stability AI cluster across 512 NVIDIA A100 40GB GPUs (AWS P4d instances).
150
+
151
+ * **Software**: We use a fork of `gpt-neox` ([EleutherAI, 2021](https://github.com/EleutherAI/gpt-neox)), train under 2D parallelism (Data and Tensor Parallel) with ZeRO-1 ([Rajbhandari et al., 2019](https://arxiv.org/abs/1910.02054v3)), and rely on flash-attention as well as SwiGLU and Rotary Embedding kernels from FlashAttention-2 ([Dao et al., 2023](https://tridao.me/publications/flash2/flash2.pdf))
152
+
153
+ ## Use and Limitations
154
+
155
+ ### Intended Use
156
+
157
+ The model is intended to be used as a foundational base model for application-specific fine-tuning. Developers must evaluate and fine-tune the model for safe performance in downstream applications.
158
+
159
+ ### Limitations and Bias
160
+
161
+ As a base model, this model may exhibit unreliable, unsafe, or other undesirable behaviors that must be corrected through evaluation and fine-tuning prior to deployment. The pre-training dataset may have contained offensive or inappropriate content, even after applying data cleansing filters, which can be reflected in the model-generated text. We recommend that users exercise caution when using these models in production systems. Do not use the models if they are unsuitable for your application, or for any applications that may cause deliberate or unintentional harm to others.
162
+
163
+ ## How to Cite
164
+
165
+ ```bibtex
166
+ @misc{StableLM-2-1.6B,
167
+ url={[https://huggingface.co/stabilityai/stablelm-2-1.6b](https://huggingface.co/stabilityai/stablelm-2-1.6b)},
168
+ title={Stable LM 2 1.6B},
169
+ author={Stability AI Language Team}
170
+ }
171
+ ```