Triangle104
commited on
Commit
•
ec9e31c
1
Parent(s):
e37b56f
Update README.md
Browse files
README.md
CHANGED
@@ -135,6 +135,92 @@ model-index:
|
|
135 |
This model was converted to GGUF format from [`ibm-granite/granite-3.0-8b-instruct`](https://huggingface.co/ibm-granite/granite-3.0-8b-instruct) using llama.cpp via the ggml.ai's [GGUF-my-repo](https://huggingface.co/spaces/ggml-org/gguf-my-repo) space.
|
136 |
Refer to the [original model card](https://huggingface.co/ibm-granite/granite-3.0-8b-instruct) for more details on the model.
|
137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
## Use with llama.cpp
|
139 |
Install llama.cpp through brew (works on Mac and Linux)
|
140 |
|
|
|
135 |
This model was converted to GGUF format from [`ibm-granite/granite-3.0-8b-instruct`](https://huggingface.co/ibm-granite/granite-3.0-8b-instruct) using llama.cpp via the ggml.ai's [GGUF-my-repo](https://huggingface.co/spaces/ggml-org/gguf-my-repo) space.
|
136 |
Refer to the [original model card](https://huggingface.co/ibm-granite/granite-3.0-8b-instruct) for more details on the model.
|
137 |
|
138 |
+
---
|
139 |
+
Model details:
|
140 |
+
-
|
141 |
+
Model Summary: Granite-3.0-8B-Instruct is a 8B parameter model finetuned from Granite-3.0-8B-Base using a combination of open source instruction datasets with permissive license and internally collected synthetic datasets. This model is developed using a diverse set of techniques with a structured chat format, including supervised finetuning, model alignment using reinforcement learning, and model merging.
|
142 |
+
|
143 |
+
Developers: Granite Team, IBM
|
144 |
+
GitHub Repository: ibm-granite/granite-3.0-language-models
|
145 |
+
Website: Granite Docs
|
146 |
+
Paper: Granite 3.0 Language Models
|
147 |
+
Release Date: October 21st, 2024
|
148 |
+
License: Apache 2.0
|
149 |
+
|
150 |
+
Supported Languages: English, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch, and Chinese. Users may finetune Granite 3.0 models for languages beyond these 12 languages.
|
151 |
+
|
152 |
+
Intended use: The model is designed to respond to general instructions and can be used to build AI assistants for multiple domains, including business applications.
|
153 |
+
|
154 |
+
Capabilities
|
155 |
+
-
|
156 |
+
Summarization
|
157 |
+
Text classification
|
158 |
+
Text extraction
|
159 |
+
Question-answering
|
160 |
+
Retrieval Augmented Generation (RAG)
|
161 |
+
Code related tasks
|
162 |
+
Function-calling tasks
|
163 |
+
Multilingual dialog use cases
|
164 |
+
|
165 |
+
Generation: This is a simple example of how to use Granite-3.0-8B-Instruct model.
|
166 |
+
|
167 |
+
Install the following libraries:
|
168 |
+
-
|
169 |
+
pip install torch torchvision torchaudio
|
170 |
+
pip install accelerate
|
171 |
+
pip install transformers
|
172 |
+
|
173 |
+
Then, copy the snippet from the section that is relevant for your use case.
|
174 |
+
|
175 |
+
import torch
|
176 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
177 |
+
|
178 |
+
device = "auto"
|
179 |
+
model_path = "ibm-granite/granite-3.0-8b-instruct"
|
180 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
181 |
+
# drop device_map if running on CPU
|
182 |
+
model = AutoModelForCausalLM.from_pretrained(model_path, device_map=device)
|
183 |
+
model.eval()
|
184 |
+
# change input text as desired
|
185 |
+
chat = [
|
186 |
+
{ "role": "user", "content": "Please list one IBM Research laboratory located in the United States. You should only output its name and location." },
|
187 |
+
]
|
188 |
+
chat = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
|
189 |
+
# tokenize the text
|
190 |
+
input_tokens = tokenizer(chat, return_tensors="pt").to(device)
|
191 |
+
# generate output tokens
|
192 |
+
output = model.generate(**input_tokens,
|
193 |
+
max_new_tokens=100)
|
194 |
+
# decode output tokens into text
|
195 |
+
output = tokenizer.batch_decode(output)
|
196 |
+
# print output
|
197 |
+
print(output)
|
198 |
+
|
199 |
+
Model Architecture: Granite-3.0-8B-Instruct is based on a decoder-only dense transformer architecture. Core components of this architecture are: GQA and RoPE, MLP with SwiGLU, RMSNorm, and shared input/output embeddings.
|
200 |
+
Model 2B Dense 8B Dense 1B MoE 3B MoE
|
201 |
+
Embedding size 2048 4096 1024 1536
|
202 |
+
Number of layers 40 40 24 32
|
203 |
+
Attention head size 64 128 64 64
|
204 |
+
Number of attention heads 32 32 16 24
|
205 |
+
Number of KV heads 8 8 8 8
|
206 |
+
MLP hidden size 8192 12800 512 512
|
207 |
+
MLP activation SwiGLU SwiGLU SwiGLU SwiGLU
|
208 |
+
Number of Experts — — 32 40
|
209 |
+
MoE TopK — — 8 8
|
210 |
+
Initialization std 0.1 0.1 0.1 0.1
|
211 |
+
Sequence Length 4096 4096 4096 4096
|
212 |
+
Position Embedding RoPE RoPE RoPE RoPE
|
213 |
+
# Parameters 2.5B 8.1B 1.3B 3.3B
|
214 |
+
# Active Parameters 2.5B 8.1B 400M 800M
|
215 |
+
# Training tokens 12T 12T 10T 10T
|
216 |
+
|
217 |
+
Training Data: Overall, our SFT data is largely comprised of three key sources: (1) publicly available datasets with permissive license, (2) internal synthetic data targeting specific capabilities, and (3) very small amounts of human-curated data. A detailed attribution of datasets can be found in the Granite Technical Report and Accompanying Author List.
|
218 |
+
|
219 |
+
Infrastructure: We train Granite 3.0 Language Models using IBM's super computing cluster, Blue Vela, which is outfitted with NVIDIA H100 GPUs. This cluster provides a scalable and efficient infrastructure for training our models over thousands of GPUs while minimizing environmental impact by utilizing 100% renewable energy sources.
|
220 |
+
|
221 |
+
Ethical Considerations and Limitations: Granite 3.0 Instruct Models are primarily finetuned using instruction-response pairs mostly in English, but also multilingual data covering eleven languages. Although this model can handle multilingual dialog use cases, its performance might not be similar to English tasks. In such case, introducing a small number of examples (few-shot) can help the model in generating more accurate outputs. While this model has been aligned by keeping safety in consideration, the model may in some cases produce inaccurate, biased, or unsafe responses to user prompts. So we urge the community to use this model with proper safety testing and tuning tailored for their specific tasks.
|
222 |
+
|
223 |
+
---
|
224 |
## Use with llama.cpp
|
225 |
Install llama.cpp through brew (works on Mac and Linux)
|
226 |
|