aashish1904 commited on
Commit
ca9f8e5
1 Parent(s): 36401c0

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +120 -0
README.md ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+
4
+ pipeline_tag: text-generation
5
+ inference: false
6
+ license: apache-2.0
7
+ library_name: transformers
8
+ tags:
9
+ - language
10
+ - granite-3.1
11
+
12
+ ---
13
+
14
+ [![QuantFactory Banner](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)](https://hf.co/QuantFactory)
15
+
16
+
17
+ # QuantFactory/granite-3.1-3b-a800m-base-GGUF
18
+ This is quantized version of [ibm-granite/granite-3.1-3b-a800m-base](https://huggingface.co/ibm-granite/granite-3.1-3b-a800m-base) created using llama.cpp
19
+
20
+ # Original Model Card
21
+
22
+
23
+ # Granite-3.1-3B-A800M-Base
24
+
25
+ **Model Summary:**
26
+ Granite-3.1-3B-A800M-Base extends the context length of Granite-3.0-3B-A800M-Base from 4K to 128K using a progressive training strategy by increasing the supported context length in increments while adjusting RoPE theta until the model has successfully adapted to desired length of 128K. This long-context pre-training stage was performed using approximately 500B tokens.
27
+
28
+ - **Developers:** Granite Team, IBM
29
+ - **GitHub Repository:** [ibm-granite/granite-3.1-language-models](https://github.com/ibm-granite/granite-3.1-language-models)
30
+ - **Website**: [Granite Docs](https://www.ibm.com/granite/docs/)
31
+ - **Paper:** [Granite 3.1 Language Models (coming soon)](https://huggingface.co/collections/ibm-granite/granite-31-language-models-6751dbbf2f3389bec5c6f02d)
32
+ - **Release Date**: December 18th, 2024
33
+ - **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
34
+
35
+ **Supported Languages:**
36
+ English, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch, and Chinese. Users may finetune Granite 3.1 models for languages beyond these 12 languages.
37
+
38
+ **Intended Use:**
39
+ Prominent use cases of LLMs in text-to-text generation include summarization, text classification, extraction, question-answering, and more. All Granite Base models are able to handle these tasks as they were trained on a large amount of data from various domains. Moreover, they can serve as baseline to create specialized models for specific application scenarios.
40
+
41
+ **Generation:**
42
+ This is a simple example of how to use Granite-3.1-3B-A800M-Base model.
43
+
44
+ Install the following libraries:
45
+
46
+ ```shell
47
+ pip install torch torchvision torchaudio
48
+ pip install accelerate
49
+ pip install transformers
50
+ ```
51
+ Then, copy the code snippet below to run the example.
52
+
53
+ ```python
54
+ from transformers import AutoModelForCausalLM, AutoTokenizer
55
+ device = "auto"
56
+ model_path = "ibm-granite/granite-3.1-3b-a800m-base"
57
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
58
+ # drop device_map if running on CPU
59
+ model = AutoModelForCausalLM.from_pretrained(model_path, device_map=device)
60
+ model.eval()
61
+ # change input text as desired
62
+ input_text = "Where is the Thomas J. Watson Research Center located?"
63
+ # tokenize the text
64
+ input_tokens = tokenizer(input_text, return_tensors="pt").to(device)
65
+ # generate output tokens
66
+ output = model.generate(**input_tokens,
67
+ max_length=4000)
68
+ # decode output tokens into text
69
+ output = tokenizer.batch_decode(output)
70
+ # print output
71
+ print(output)
72
+ ```
73
+
74
+ **Model Architecture:**
75
+ Granite-3.1-3B-A800M-Base is based on a decoder-only sparse Mixture of Experts (MoE) transformer architecture. Core components of this architecture are: Fine-grained Experts, Dropless Token Routing, and Load Balancing Loss.
76
+
77
+ | Model | 2B Dense | 8B Dense | 1B MoE | 3B MoE |
78
+ | :-------- | :--------| :--------| :-------- | :--------|
79
+ | Embedding size | 2048 | 4096 | 1024 | **1536** |
80
+ | Number of layers | 40 | 40 | 24 | **32** |
81
+ | Attention head size | 64 | 128 | 64 | **64** |
82
+ | Number of attention heads | 32 | 32 | 16 | **24** |
83
+ | Number of KV heads | 8 | 8 | 8 | **8** |
84
+ | MLP hidden size | 8192 | 12800 | 512 | **512** |
85
+ | MLP activation | SwiGLU | SwiGLU | SwiGLU | **SwiGLU** |
86
+ | Number of experts | — | — | 32 | **40** |
87
+ | MoE TopK | — | — | 8 | **8** |
88
+ | Initialization std | 0.1 | 0.1 | 0.1 | **0.1** |
89
+ | Sequence length | 128K | 128k | 128K | **128K** |
90
+ | Position embedding | RoPE | RoPE | RoPE | **RoPE** |
91
+ | # Parameters | 2.5B | 8.1B | 1.3B | **3.3B** |
92
+ | # Active parameters | 2.5B | 8.1B | 400M | **800M** |
93
+ | # Training tokens | 12T | 12T | 10T | **10T** |
94
+
95
+ **Training Data:**
96
+ This model is trained on a mix of open source and proprietary data following a two-stage training strategy.
97
+ * Stage 1 data: The data for stage 1 is sourced from diverse domains, such as: web, code, academic sources, books, and math data.
98
+ * Stage 2 data: The data for stage 2 comprises a curated mix of high-quality data from the same domains, plus multilingual and instruction data. The goal of this second training phase is to enhance the model’s performance on specific tasks.
99
+ * Stage 3 data: The data for stage 3 consists of original stage-2 pretraining data with additional synthetic long-context data in form of QA/summary pairs where the answer contains a recitation of the related paragraph before the answer.
100
+
101
+ A detailed attribution of datasets can be found in the [Granite 3.0 Technical Report](https://github.com/ibm-granite/granite-3.0-language-models/blob/main/paper.pdf), [Granite 3.1 Technical Report (coming soon)](https://huggingface.co/collections/ibm-granite/granite-31-language-models-6751dbbf2f3389bec5c6f02d), and [Accompanying Author List](https://github.com/ibm-granite/granite-3.0-language-models/blob/main/author-ack.pdf).
102
+
103
+ **Infrastructure:**
104
+ We train Granite 3.1 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.
105
+
106
+ **Ethical Considerations and Limitations:**
107
+ The use of Large Language Models involves risks and ethical considerations people must be aware of, including but not limited to: bias and fairness, misinformation, and autonomous decision-making. Granite-3.1-3B-A800M-Base model is not the exception in this regard. Even though this model is suited for multiple generative AI tasks, it has not undergone any safety alignment, there it may produce problematic outputs. Additionally, it remains uncertain whether smaller models might exhibit increased susceptibility to hallucination in generation scenarios by copying text verbatim from the training dataset due to their reduced sizes and memorization capacities. This aspect is currently an active area of research, and we anticipate more rigorous exploration, comprehension, and mitigations in this domain. Regarding ethics, a latent risk associated with all Large Language Models is their malicious utilization. We urge the community to use Granite-3.1-3B-A800M-Base model with ethical intentions and in a responsible way.
108
+
109
+ <!-- ## Citation
110
+ ```
111
+ @misc{granite-models,
112
+ author = {author 1, author2, ...},
113
+ title = {},
114
+ journal = {},
115
+ volume = {},
116
+ year = {2024},
117
+ url = {https://arxiv.org/abs/0000.00000},
118
+ }
119
+ ``` -->
120
+