Transformers
GGUF
komodo
Inference Endpoints
aashish1904 commited on
Commit
a7c30c4
·
verified ·
1 Parent(s): 6416705

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +188 -0
README.md ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+
4
+ language:
5
+ - id
6
+ - en
7
+ - jv
8
+ - su
9
+ license: llama2
10
+ library_name: transformers
11
+ tags:
12
+ - komodo
13
+
14
+ ---
15
+
16
+ [![QuantFactory Banner](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)](https://hf.co/QuantFactory)
17
+
18
+
19
+ # QuantFactory/komodo-7b-base-GGUF
20
+ This is quantized version of [Yellow-AI-NLP/komodo-7b-base](https://huggingface.co/Yellow-AI-NLP/komodo-7b-base) created using llama.cpp
21
+
22
+ # Original Model Card
23
+
24
+
25
+ # Model Card for Komodo-7B-Base
26
+
27
+ Komodo-7B-Base is a large language model that is developed through incremental pretraining and vocabulary expansion on top of Llama-2-7B-Base. This model can handle Indonesian, English and 11 regional languages of Indonesia.
28
+
29
+ **Disclaimer** : This is not an instruction-tuned model, further fine-tuning is needed for downstream tasks. For example, people usually utilize the [Alpaca](https://huggingface.co/datasets/tatsu-lab/alpaca) dataset for further fine-tuning on top of Llama-2-7B-Base model. Hence, there is no prompt template for this model.
30
+
31
+
32
+ ## Model Details
33
+
34
+ <h3 align="center">
35
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/638828121901766b88076aa1/eB0L_nmy3ZpwtGA6-vhbC.png" width="950" align="center">
36
+ </h3>
37
+
38
+
39
+ ### Model Description
40
+
41
+
42
+ More details can be found in our paper: https://arxiv.org/abs/2403.09362
43
+
44
+ - **Developed by:** [Yellow.ai](https://yellow.ai/)
45
+ - **Model type:** Decoder
46
+ - **Languages:** English, Indonesian, Acehnese, Balinese, Banjarese, Buginese, Madurese, Minangkabau, Javanese, Dayak Ngaju, Sundanese, Toba Batak, Lampungnese
47
+ - **License:** llama2
48
+
49
+
50
+
51
+
52
+ ## Usage Example
53
+
54
+ Since this is a gated model, you need to logged in to your HF account before using the model. Below is one way to do this. You can get the HF Token from your profile (Profile -> Settings -> Access Tokens)
55
+
56
+ ```
57
+ import huggingface_hub
58
+ huggingface_hub.login("YOUR_HF_TOKEN")
59
+ ```
60
+
61
+ Once you are logged in, you can start download and load the model & tokenizer. We wrote a custom decoding function for Komodo-7B, that's why we need to pass the `trust_remote_code=True`. The code also works without this parameter, but decoding process will not work as expected.
62
+
63
+ ```
64
+ import torch
65
+ from transformers import AutoTokenizer, AutoModelForCausalLM
66
+
67
+ device = "cuda:0" if torch.cuda.is_available() else "cpu"
68
+
69
+ tokenizer = AutoTokenizer.from_pretrained("Yellow-AI-NLP/komodo-7b-base",trust_remote_code=True)
70
+ model = AutoModelForCausalLM.from_pretrained("Yellow-AI-NLP/komodo-7b-base",trust_remote_code=True)
71
+ model = model.to(device)
72
+ ```
73
+
74
+ Then, you can try using the model.
75
+
76
+ ```
77
+ full_prompt = "Candi borobudur adalah"
78
+
79
+ tokens = tokenizer(full_prompt, return_tensors="pt").to(device)
80
+ output = model.generate(tokens["input_ids"], eos_token_id=tokenizer.eos_token_id)
81
+
82
+ print(tokenizer.decode(output[0], skip_special_tokens=True))
83
+ # Candi borobudur adalah candi yang terletak di Magelang, Jawa Tengah.
84
+ ```
85
+
86
+ ## Technical Specifications
87
+
88
+ ### Model Architecture and Objective
89
+
90
+ Komodo-7B is a decoder model using the Llama-2 architecture.
91
+
92
+ | Parameter | Komodo-7B |
93
+ |-----------------|:-----------:|
94
+ | Layers | 32 |
95
+ | d_model | 4096 |
96
+ | head_dim | 32 |
97
+ | Vocabulary | 35008 |
98
+ | Sequence Length | 4096 |
99
+
100
+
101
+ ### Tokenizer Details
102
+
103
+ Recognizing the importance of linguistic diversity, we focused on enhancing our language model's proficiency in both Indonesian and regional languages. To achieve this, we systematically expanded the tokenizer's vocabulary by identifying and incorporating approximately 2,000 frequently used words specific to Indonesian and 1,000 words for regional languages that were absent in the Llama-2 model.
104
+
105
+ The standard method for enhancing a vocabulary typically involves developing a new tokenizer and integrating it with the existing one. This technique has shown impressive results in projects like Chinese-LLaMA and Open-Hathi. The effectiveness of this strategy can be attributed to the significant linguistic distinctions between languages such as Chinese and Hindi when compared to English. In contrast, the Indonesian language employs the same Latin script as English, which presents a different set of challenges.
106
+
107
+ We tested the traditional method, as well as a new approach where we included the top n words (not tokens) from the Indonesian vocabulary. We discovered that with the new approach, we could achieve better fertility scores by adding around 3000 new vocabulary words. Adding more than 3000 words did not significantly improve the fertility score further, but it increased the size of the embedding matrix, leading to longer training times.
108
+
109
+ More details can be found in our paper: https://arxiv.org/abs/2403.09362
110
+
111
+ ### Training Data
112
+
113
+ More details can be found in our paper: https://arxiv.org/abs/2403.09362
114
+
115
+
116
+ ### Training Procedure
117
+
118
+ More details can be found in our paper: https://arxiv.org/abs/2403.09362
119
+
120
+
121
+ #### Preprocessing
122
+
123
+ More details can be found in our paper: https://arxiv.org/abs/2403.09362
124
+
125
+
126
+ ## Evaluation & Results
127
+
128
+ Please note that the benchmarking values below are based on our SFT Model, Komodo-7B-Instruct, while here we only release the base model, Komodo-7B-base.
129
+
130
+ | Organization | Model Name | Indo MMLU | ID-EN | XCOPA-ID | Intent Classification | Colloquial Detection | NusaX-Senti | ID-Hate Speech | TydiQA-ID | Indosum | Average |
131
+ |--------------|--------------------|-----------|-------|----------|-----------------------|----------------------|-------------|----------------|-----------|---------|---------|
132
+ | OpenAI | GPT-3.5-turbo-0301 | 51.3 | 64.5 | 70.0 | 82.0 | 64.1 | 47.2 | 68.0 | 85.3 | 41.0 | 63.7 |
133
+ | OpenAI | GPT-3.5-turbo-0613 | 52.7 | 66.8 | 88.2 | 84.0 | 75.1 | 63.3 | 63.7 | 86.4 | 40.0 | 68.9 |
134
+ | OpenAI | GPT-3.5-turbo-1106 | 53.3 | 69.7 | 89.3 | 84.0 | 64.2 | 59.8 | 56.6 | 88.0 | 42.0 | 67.4 |
135
+ | OpenAI | GPT-4-preview-1106 | 69.8 | 78.0 | 98.3 | 89.0 | 92.7 | 66.1 | 73.4 | 72.0 | 33.0 | 74.7 |
136
+ | Meta | Llama-2-7B-Chat | 30.4 | 45.6 | 41.5 | 57.0 | 31.4 | 2.9 | 41.3 | 11.7 | 34.0 | 32.9 |
137
+ | Meta | Llama-2-13B-Chat | 32.0 | 61.7 | 38.0 | 59.0 | 31.1 | 58.7 | 57.2 | 71.9 | 40.0 | 50.0 |
138
+ | Google | Gemma-7B-it | 37.4 | 73.6 | 57.7 | 77.1 | 18.8 | 44.2 | 54.8 | 73.3 | 44.0 | 53.4 |
139
+ | Mistral | Mixtral-8x7B-v0.1-Instruct | 45.2 | 57.8 | 88.7 | 86.0 | 41.1 | 52.8 | 68.8 | 90.3 | 14.0 | 60.5 |
140
+ | AISingapore | Sealion-7B-Instruct-NC | 23.9 | 26.9 | 41.3 | 37.0 | 41.8 | 30.7 | 57.3 | 65.3 | 26.0 | 38.9 |
141
+ | Cohere | Aya-101-13B | 47.7 | 47.3 | 84.0 | 64.0 | 18.9 | 74.6 | 72.7 | 81.3 | 39.0 | 58.8 |
142
+ | MBZUAI | Bactrian-X-Llama-7B | 23.6 | 43.2 | 45.3 | 42.0 | 50.3 | 44.5 | 42.4 | 65.0 | 15.0 | 41.3 |
143
+ | Alibaba | Qwen-1.5-7B-chat | 40.0 | 56.0 | 29.5 | 85.0 | 41.8 | 58.7 | 63.9 | 51.22 | 29.0 | 50.6 |
144
+ | Yellow.ai | Komodo-7B-Instruct | 43.2 | 90.5 | 79.6 | 84.0 | 73.6 | 79.3 | 56.2 | 90.3 | 43.0 | 71.1 |
145
+
146
+
147
+
148
+
149
+ <h3 align="center">
150
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/638828121901766b88076aa1/CJkSjsVnC8MoMolIQ_Uv3.png" width="550" align="center">
151
+ </h3>
152
+
153
+
154
+ More details can be found in our paper: https://arxiv.org/abs/2403.09362
155
+
156
+
157
+ ### Infrastructure
158
+
159
+
160
+ | Training Details | Komodo-7B |
161
+ |----------------------|:------------:|
162
+ | AWS EC2 p4d.24xlarge | 1 instances |
163
+ | Nvidia A100 40GB GPU | 8 |
164
+ | Training Duration | 300 hours |
165
+
166
+
167
+
168
+ ## Citation
169
+ ```
170
+ @misc{owen2024komodo,
171
+ title={Komodo: A Linguistic Expedition into Indonesia's Regional Languages},
172
+ author={Louis Owen and Vishesh Tripathi and Abhay Kumar and Biddwan Ahmed},
173
+ year={2024},
174
+ eprint={2403.09362},
175
+ archivePrefix={arXiv},
176
+ primaryClass={cs.CL}
177
+ }
178
+ ```
179
+
180
+
181
+
182
+
183
+ ## Model Card Authors
184
+
185
+ [Louis Owen](https://www.linkedin.com/in/louisowen/) <br>
186
+ [Vishesh Tripathi](https://www.linkedin.com/in/vishesh-tripathi/) <br>
187
+ [Abhay Kumar](https://www.linkedin.com/in/akanyaani/) <br>
188
+ [Biddwan Ahmed](https://www.linkedin.com/in/biddwan-ahmed-917333126/) <br>