RichardErkhov commited on
Commit
ad792dc
·
verified ·
1 Parent(s): e4b4b37

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +221 -0
README.md ADDED
@@ -0,0 +1,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ prem-1B - GGUF
11
+ - Model creator: https://huggingface.co/premai-io/
12
+ - Original model: https://huggingface.co/premai-io/prem-1B/
13
+
14
+
15
+ | Name | Quant method | Size |
16
+ | ---- | ---- | ---- |
17
+ | [prem-1B.Q2_K.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.Q2_K.gguf) | Q2_K | 0.4GB |
18
+ | [prem-1B.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.IQ3_XS.gguf) | IQ3_XS | 0.44GB |
19
+ | [prem-1B.IQ3_S.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.IQ3_S.gguf) | IQ3_S | 0.47GB |
20
+ | [prem-1B.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.Q3_K_S.gguf) | Q3_K_S | 0.47GB |
21
+ | [prem-1B.IQ3_M.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.IQ3_M.gguf) | IQ3_M | 0.48GB |
22
+ | [prem-1B.Q3_K.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.Q3_K.gguf) | Q3_K | 0.51GB |
23
+ | [prem-1B.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.Q3_K_M.gguf) | Q3_K_M | 0.51GB |
24
+ | [prem-1B.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.Q3_K_L.gguf) | Q3_K_L | 0.55GB |
25
+ | [prem-1B.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.IQ4_XS.gguf) | IQ4_XS | 0.57GB |
26
+ | [prem-1B.Q4_0.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.Q4_0.gguf) | Q4_0 | 0.59GB |
27
+ | [prem-1B.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.IQ4_NL.gguf) | IQ4_NL | 0.6GB |
28
+ | [prem-1B.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.Q4_K_S.gguf) | Q4_K_S | 0.6GB |
29
+ | [prem-1B.Q4_K.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.Q4_K.gguf) | Q4_K | 0.62GB |
30
+ | [prem-1B.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.Q4_K_M.gguf) | Q4_K_M | 0.62GB |
31
+ | [prem-1B.Q4_1.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.Q4_1.gguf) | Q4_1 | 0.65GB |
32
+ | [prem-1B.Q5_0.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.Q5_0.gguf) | Q5_0 | 0.71GB |
33
+ | [prem-1B.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.Q5_K_S.gguf) | Q5_K_S | 0.71GB |
34
+ | [prem-1B.Q5_K.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.Q5_K.gguf) | Q5_K | 0.73GB |
35
+ | [prem-1B.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.Q5_K_M.gguf) | Q5_K_M | 0.73GB |
36
+ | [prem-1B.Q5_1.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.Q5_1.gguf) | Q5_1 | 0.77GB |
37
+ | [prem-1B.Q6_K.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.Q6_K.gguf) | Q6_K | 0.84GB |
38
+ | [prem-1B.Q8_0.gguf](https://huggingface.co/RichardErkhov/premai-io_-_prem-1B-gguf/blob/main/prem-1B.Q8_0.gguf) | Q8_0 | 1.09GB |
39
+
40
+
41
+
42
+
43
+ Original model description:
44
+ ---
45
+ library_name: transformers
46
+ license: apache-2.0
47
+ datasets:
48
+ - cerebras/SlimPajama-627B
49
+ - HuggingFaceH4/ultrachat_200k
50
+ - hkust-nlp/deita-10k-v0
51
+ - Open-Orca/SlimOrca-Dedup
52
+ - cognitivecomputations/WizardLM_evol_instruct_V2_196k_unfiltered_merged_split
53
+ - HuggingFaceH4/capybara
54
+ - meta-math/MetaMathQA
55
+ - argilla/ultrafeedback-binarized-preferences-cleaned
56
+ - Intel/orca_dpo_pairs
57
+ - alexredna/oasst2_dpo_pairs
58
+ pipeline_tag: text-generation
59
+ ---
60
+
61
+
62
+ ## Model Details
63
+
64
+ With great enthusiasm, we unveil the Prem-1B series, open-source, multipurpose large language models developed by Prem AI. This cutting-edge SLM offers the open community and enterprises the opportunity to harness capabilities that were once exclusively available through closed model APIs, empowering them to build their own advanced language models. Our objective is to develop a model that excels at Retrieval-Augmented Generation (RAG). While Large Language Models (LLMs) store a vast amount of information within their parameters, RAG operates differently by ingesting information during runtime. This approach suggests that for RAG applications, we may not require models of immense size. With this initiative, we aim to create a Small Language Model (SLM) with an extended context length of 8192 tokens, enabling it to handle multi-turn conversations effectively. This endeavor represents our inaugural attempt to craft an SLM tailored for RAG tasks.
65
+
66
+ ### Model Description
67
+
68
+ <!-- Provide a longer summary of what this model is. -->
69
+
70
+ This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
71
+
72
+ - **Developed by:** https://premai.io/
73
+ - **Model type:** Llama
74
+ - **Language(s) (NLP):** Python
75
+ - **License:** Apache License 2.0
76
+
77
+
78
+ ## Uses
79
+
80
+ The Prem-1B language model is designed for commercial and research applications involving the English language. The instruction-tuned versions of the model are tailored for conversational interactions akin to a virtual assistant. On the other hand, the pretrained variants can be fine-tuned and adapted for various natural language generation tasks beyond just dialogue.
81
+
82
+ ### Out-of-Scope Use
83
+
84
+ The model must not be used in any manner that violates applicable laws or regulations, including trade compliance laws. It is also prohibited to use the model in any way that goes against the Acceptable Use Policy and the Prem-1B Community License. While the base model is intended for English language use, developers are permitted to fine-tune the Prem-1B models for other languages, provided they comply with the Prem-1B Community License and the Acceptable Use Policy.
85
+
86
+
87
+ ### Recommendations
88
+
89
+ Users (both direct and downstream) should be made aware of the risks, biases, and limitations of the model. More information needed for further recommendations.
90
+
91
+ ## How to Get Started with the Model
92
+
93
+ Using `AutoModelForCausalLM` and `AutoTokenizer`
94
+ ```py
95
+ from transformers import AutoTokenizer, AutoModelForCausalLM
96
+
97
+ # Load the model and tokenizer
98
+ tokenizer = AutoTokenizer.from_pretrained("premai-io/prem-1B-chat")
99
+ model = AutoModelForCausalLM.from_pretrained('premai-io/prem-1B-chat', torch_dtype=torch.bfloat16)
100
+ model = model.to('cuda')
101
+
102
+ # Setup terminators
103
+ terminators = [tokenizer.eos_token_id, tokenizer.encode('<|eot_id|>', add_special_tokens=False)[0]]
104
+
105
+ # Prepare the prompt
106
+ messages = [
107
+ {
108
+ "role": "system",
109
+ "content": "You are a helpful AI assistant. You should give concise responses to very simple questions, but provide thorough responses to more complex and open-ended questions."
110
+ },
111
+ {
112
+ 'role': 'user',
113
+ 'content': 'Help me understand machine learning.'
114
+ }
115
+ ]
116
+
117
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
118
+
119
+ # Generate
120
+ inputs = tokenizer(prompt, return_attention_mask=False, return_tensors="pt", add_special_tokens=False)
121
+ input_ids = inputs['input_ids']
122
+ input_ids = input_ids.to(model.device)
123
+ res = model.generate(input_ids=input_ids, max_new_tokens=400, pad_token_id=tokenizer.pad_token_id, eos_token_id=terminators)
124
+ generated_text = tokenizer.decode(res[0][input_ids.shape[1]:], skip_special_tokens=True).strip()
125
+ print(generated_text)
126
+ ```
127
+
128
+ Using pipelines:
129
+ ```py
130
+ import torch
131
+ from transformers import pipeline
132
+
133
+ # Load the pipeline
134
+ pipe = pipeline("text-generation", model="premai-io/prem-1B-chat", torch_dtype=torch.bfloat16, device=0)
135
+
136
+ # Prepare prompt
137
+ messages = [
138
+ {
139
+ "role": "system",
140
+ "content": "You are a helpful AI assistant. You should give concise responses to very simple questions, but provide thorough responses to more complex and open-ended questions."
141
+ },
142
+ {
143
+ 'role': 'user',
144
+ 'content': 'Help me understand machine learning.'
145
+ }
146
+ ]
147
+ prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
148
+
149
+ # Setup terminators
150
+ terminators = [pipe.tokenizer.eos_token_id, pipe.tokenizer.encode('<|eot_id|>', add_special_tokens=False)[0]]
151
+
152
+ # Generate
153
+ outputs = pipe(prompt, max_new_tokens=400, do_sample=True, temperature=0.7, top_k=50, top_p=0.95, pad_token_id=pipe.tokenizer.pad_token_id, eos_token_id=terminators)
154
+ print(outputs[0]["generated_text"][len(prompt):])
155
+ ```
156
+
157
+ ## Training Details
158
+
159
+ ### Training Data
160
+
161
+ Mentioned in blogpost: https://blog.premai.io/introducing-prem-1b/
162
+
163
+ ### Training Procedure
164
+
165
+ Mentioned in blogpost: https://blog.premai.io/introducing-prem-1b/
166
+
167
+ #### Training Hyperparameters
168
+
169
+ Mentioned in blogpost: https://blog.premai.io/introducing-prem-1b/
170
+
171
+
172
+ ## Evaluation
173
+
174
+ ### Results
175
+
176
+ |Model |Avg |Arc-c|Arc-e|Hellaswag|MMLU |Obqa |Piqa |Winogrande|
177
+ |------------------------|-----|-----|-----|---------|-----|-----|-----|----------|
178
+ |prem-1B |42.64|24.74|57.40|42.01 |24.75|21.00|72.14|56.43 |
179
+ |prem-1B-chat |41.76|24.48|53.32|40.28 |25.27|22.20|70.89|55.88 |
180
+ |TinyLlama-1.1B-Chat-v1.0|46.16|30.03|61.53|46.56 |24.72|25.80|74.21|60.29 |
181
+ |opt-1.3b |42.94|23.37|57.44|41.49 |24.86|23.20|71.49|58.72 |
182
+ |pythia-1b |40.71|24.31|56.90|37.72 |23.20|18.80|70.62|53.43 |
183
+
184
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/5f440d8f79c1ba4c353d0f6d/PqscXKPvnwvymNxqYAxjR.png)
185
+
186
+
187
+ ## Environmental Impact
188
+
189
+ - **Hardware Type:** H100 GPUs
190
+ - **Hours used:** 8500
191
+
192
+
193
+ ### Model Architecture and Objective
194
+
195
+ Llama based
196
+
197
+ ### Compute Infrastructure
198
+
199
+ 16-H100 GPUs
200
+
201
+ #### Hardware
202
+
203
+ H100 GPUs
204
+
205
+ #### Software
206
+
207
+ PyTorch, transformers, PyTorch Lightning
208
+
209
+ ## Citation
210
+
211
+ https://blog.premai.io/introducing-prem-1b/
212
+
213
+
214
+ ## Model Card Authors
215
+
216
+ https://huggingface.co/goku, https://huggingface.co/nsosio, https://huggingface.co/ucalyptus, https://huggingface.co/filopedraz
217
+
218
+ ## Model Card Contact
219
+
220
+ https://huggingface.co/goku, https://huggingface.co/nsosio, https://huggingface.co/ucalyptus, https://huggingface.co/filopedraz
221
+