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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
datasets:
|
3 |
+
- wikipedia
|
4 |
+
- Ichsan2895/OASST_Top1_Indonesian
|
5 |
+
- Ichsan2895/alpaca-gpt4-indonesian
|
6 |
+
language:
|
7 |
+
- id
|
8 |
+
- en
|
9 |
+
pipeline_tag: text-generation
|
10 |
+
license: cc-by-nc-sa-4.0
|
11 |
+
other: mistral
|
12 |
+
---
|
13 |
+
|
14 |
+
# HAPPY TO ANNOUNCE THE RELEASE OF MERAK-7B-V4-PROTOTYPE6-GGUF!
|
15 |
+
|
16 |
+
Merak-7B is the Large Language Model of Indonesian Language
|
17 |
+
|
18 |
+
This model is based on [Mistral-7B-OpenOrca](https://huggingface.co/Open-Orca/Mistral-7B-OpenOrca) and fine tuned by some of Indonesia Wikipedia articles that I cleaned before.
|
19 |
+
|
20 |
+
Leveraging QLoRA (QLora: Efficient Finetuning of Quantized LLMs), Merak-7B is able to run with 16 GB VRAM
|
21 |
+
|
22 |
+
Merak-7B and all of its derivatives are Licensed under Creative Commons-By Attribution-Share Alike-Non Commercial (CC-BY-SA-NC 4.0). Merak-7B empowers AI enthusiasts, researchers alike.
|
23 |
+
|
24 |
+
Big thanks to all my friends and communities that help to build our first model. Thanks for Axolotl for a great fine tuning tool which designed to streamline the fine-tuning of various AI models.
|
25 |
+
|
26 |
+
Feel free, to ask me about the model and please share the news on your social media.
|
27 |
+
|
28 |
+
## HOW TO USE
|
29 |
+
### What is GGUF
|
30 |
+
GGUF is a new format introduced by the llama.cpp team on August 21st 2023. It is a replacement for GGML, which is no longer supported by llama.cpp.
|
31 |
+
|
32 |
+
### What is the software that support GGUF
|
33 |
+
Here is an incomplate list of clients and libraries that are known to support GGUF:
|
34 |
+
|
35 |
+
* [llama.cpp](https://github.com/ggerganov/llama.cpp). The source project for GGUF. Offers a CLI and a server option.
|
36 |
+
* [text-generation-webui](https://github.com/oobabooga/text-generation-webui), the most widely used web UI, with many features and powerful extensions. Supports GPU acceleration.
|
37 |
+
* [KoboldCpp](https://github.com/LostRuins/koboldcpp), a fully featured web UI, with GPU accel across all platforms and GPU architectures. Especially good for story telling.
|
38 |
+
* [LM Studio](https://lmstudio.ai/), an easy-to-use and powerful local GUI for Windows and macOS (Silicon), with GPU acceleration.
|
39 |
+
* [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui), a great web UI with many interesting and unique features, including a full model library for easy model selection.
|
40 |
+
* [Faraday.dev](https://faraday.dev/), an attractive and easy to use character-based chat GUI for Windows and macOS (both Silicon and Intel), with GPU acceleration.
|
41 |
+
* [ctransformers](https://github.com/marella/ctransformers), a Python library with GPU accel, LangChain support, and OpenAI-compatible AI server.
|
42 |
+
* [llama-cpp-python](https://github.com/abetlen/llama-cpp-python), a Python library with GPU accel, LangChain support, and OpenAI-compatible API server.
|
43 |
+
* [candle](https://github.com/huggingface/candle), a Rust ML framework with a focus on performance, including GPU support, and ease of use.
|
44 |
+
|
45 |
+
### Compatibility
|
46 |
+
These quantised GGUFv2 files are compatible with llama.cpp from August 27th onwards, as of commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221)
|
47 |
+
|
48 |
+
They are also compatible with many third party UIs and libraries - please see the list at the top of this README.
|
49 |
+
|
50 |
+
### Provided files
|
51 |
+
|
52 |
+
| Name | Quant method | Bits | Size | Use case |
|
53 |
+
| ---- | ---- | ---- | ---- | ----- |
|
54 |
+
| [Merak-7B-v4-PROTOTYPE6-model-Q2_K.gguf](https://huggingface.co/Ichsan2895/Merak-7B-v4-PROTOTYPE6-GGUF/blob/main/Merak-7B-v4-PROTOTYPE6-model-q2_k.gguf) | Q2_K | 2 | 2.83 GB| smallest, significant quality loss - not recommended for most purposes |
|
55 |
+
| [Merak-7B-v4-PROTOTYPE6-model-Q3_K_M.gguf](https://huggingface.co/Ichsan2895/Merak-7B-v4-PROTOTYPE6-GGUF/blob/main/Merak-7B-v4-PROTOTYPE6-model-q3_k_m.gguf) | Q3_K_M | 3 | 3.3 GB| very small, high quality loss |
|
56 |
+
| [Merak-7B-v4-PROTOTYPE6-model-Q4_0.gguf](https://huggingface.co/Ichsan2895/Merak-7B-v4-PROTOTYPE6-GGUF/blob/main/Merak-7B-v4-PROTOTYPE6-model-q4_0.gguf) | Q4_0 | 4 | 3.83 GB| legacy; small, very high quality loss - prefer using Q3_K_M |
|
57 |
+
| [Merak-7B-v4-PROTOTYPE6-model-Q4_K_M.gguf](https://huggingface.co/Ichsan2895/Merak-7B-v4-PROTOTYPE6-GGUF/blob/main/Merak-7B-v4-PROTOTYPE6-model-q4_k_m.gguf) | Q4_K_M | 4 | 4.08 GB| medium, balanced quality - recommended |
|
58 |
+
| [Merak-7B-v4-PROTOTYPE6-model-Q5_0.gguf](https://huggingface.co/Ichsan2895/Merak-7B-v4-PROTOTYPE6-GGUF/blob/main/Merak-7B-v4-PROTOTYPE6-model-q5_0.gguf) | Q5_0 | 5 | 4.65 GB| legacy; medium, balanced quality - prefer using Q4_K_M |
|
59 |
+
| [Merak-7B-v4-PROTOTYPE6-model-Q5_K_M.gguf](https://huggingface.co/Ichsan2895/Merak-7B-v4-PROTOTYPE6-GGUF/blob/main/Merak-7B-v4-PROTOTYPE6-model-q5_k_m.gguf) | Q5_K_M | 5 | 4.78 GB| large, very low quality loss - recommended |
|
60 |
+
| [Merak-7B-v4-PROTOTYPE6-model-Q6_K.gguf](https://huggingface.co/Ichsan2895/Merak-7B-v4-PROTOTYPE6-GGUF/blob/main/Merak-7B-v4-PROTOTYPE6-model-q6_k.gguf) | Q6_K | 6 | 5.53 GB| very large, extremely low quality loss |
|
61 |
+
| [Merak-7B-v4-PROTOTYPE6-model-Q8_0.gguf](https://huggingface.co/Ichsan2895/Merak-7B-v4-PROTOTYPE6-GGUF/blob/main/Merak-7B-v4-PROTOTYPE6-model-q8_0.gguf) | Q8_0 | 8 | 7.16 GB| very large, extremely low quality loss - not recommended |
|
62 |
+
|
63 |
+
**Note**: the above RAM figures assume no GPU offloading. If layers are offloaded to the GPU, this will reduce RAM usage and use VRAM instead.
|
64 |
+
|
65 |
+
### Explanation of quantisation methods
|
66 |
+
<details>
|
67 |
+
<summary>Click to see details</summary>
|
68 |
+
|
69 |
+
The new methods available are:
|
70 |
+
* GGML_TYPE_Q2_K - "type-1" 2-bit quantization in super-blocks containing 16 blocks, each block having 16 weight. Block scales and mins are quantized with 4 bits. This ends up effectively using 2.5625 bits per weight (bpw)
|
71 |
+
* GGML_TYPE_Q3_K - "type-0" 3-bit quantization in super-blocks containing 16 blocks, each block having 16 weights. Scales are quantized with 6 bits. This end up using 3.4375 bpw.
|
72 |
+
* GGML_TYPE_Q4_K - "type-1" 4-bit quantization in super-blocks containing 8 blocks, each block having 32 weights. Scales and mins are quantized with 6 bits. This ends up using 4.5 bpw.
|
73 |
+
* GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
|
74 |
+
* GGML_TYPE_Q6_K - "type-0" 6-bit quantization. Super-blocks with 16 blocks, each block having 16 weights. Scales are quantized with 8 bits. This ends up using 6.5625 bpw
|
75 |
+
</details>
|
76 |
+
|
77 |
+
## How to download GGUF files
|
78 |
+
|
79 |
+
**Note for manual downloaders:** You almost never want to clone the entire repo! Multiple different quantisation formats are provided, and most users only want to pick and download a single file.
|
80 |
+
|
81 |
+
The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
|
82 |
+
- LM Studio
|
83 |
+
- LoLLMS Web UI
|
84 |
+
- Faraday.dev
|
85 |
+
|
86 |
+
### In `text-generation-webui`
|
87 |
+
|
88 |
+
Under Download Model, you can enter the model repo: Ichsan2895/Merak-7B-v4-PROTOTYPE6-GGUF and below it, a specific filename to download, such as: Merak-7B-v4-PROTOTYPE6-model-q5_k_m.gguf.
|
89 |
+
|
90 |
+
Then click Download.
|
91 |
+
|
92 |
+
### On the command line, including multiple files at once
|
93 |
+
|
94 |
+
I recommend using the `huggingface-hub` Python library:
|
95 |
+
|
96 |
+
```shell
|
97 |
+
pip3 install huggingface-hub
|
98 |
+
```
|
99 |
+
|
100 |
+
Then you can download any individual model file to the current directory, at high speed, with a command like this:
|
101 |
+
|
102 |
+
```shell
|
103 |
+
huggingface-cli download Ichsan2895/Merak-7B-v4-PROTOTYPE6-GGUF Merak-7B-v4-PROTOTYPE6-model-q5_k_m.gguf --local-dir . --local-dir-use-symlinks False
|
104 |
+
```
|
105 |
+
|
106 |
+
<details>
|
107 |
+
<summary>More advanced huggingface-cli download usage</summary>
|
108 |
+
|
109 |
+
You can also download multiple files at once with a pattern:
|
110 |
+
|
111 |
+
```shell
|
112 |
+
huggingface-cli download Ichsan2895/Merak-7B-v4-PROTOTYPE6-GGUF --local-dir . --local-dir-use-symlinks False --include='*Q4_K*gguf'
|
113 |
+
```
|
114 |
+
|
115 |
+
For more documentation on downloading with `huggingface-cli`, please see: [HF -> Hub Python Library -> Download files -> Download from the CLI](https://huggingface.co/docs/huggingface_hub/guides/download#download-from-the-cli).
|
116 |
+
|
117 |
+
To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
|
118 |
+
|
119 |
+
```shell
|
120 |
+
pip3 install hf_transfer
|
121 |
+
```
|
122 |
+
|
123 |
+
And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
|
124 |
+
|
125 |
+
```shell
|
126 |
+
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download Ichsan2895/Merak-7B-v4-PROTOTYPE6-GGUF Merak-7B-v4-PROTOTYPE6-model-q5_k_m.gguf --local-dir . --local-dir-use-symlinks False
|
127 |
+
```
|
128 |
+
|
129 |
+
Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
|
130 |
+
</details>
|
131 |
+
<!-- README_GGUF.md-how-to-download end -->
|
132 |
+
|
133 |
+
<!-- README_GGUF.md-how-to-run start -->
|
134 |
+
## Example `llama.cpp` command
|
135 |
+
|
136 |
+
Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
|
137 |
+
|
138 |
+
```shell
|
139 |
+
./main -ngl 32 -m Merak-7B-v4-PROTOTYPE6-model-q5_k_m.gguf --color -c 2048 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "<|im_start|>system\n{system_message}<|im_end|>\n<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant"
|
140 |
+
```
|
141 |
+
|
142 |
+
Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
|
143 |
+
|
144 |
+
Change `-c 2048` to the desired sequence length. For extended sequence models - eg 8K, 16K, 32K - the necessary RoPE scaling parameters are read from the GGUF file and set by llama.cpp automatically.
|
145 |
+
|
146 |
+
If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
|
147 |
+
|
148 |
+
For other parameters and how to use them, please refer to [the llama.cpp documentation](https://github.com/ggerganov/llama.cpp/blob/master/examples/main/README.md)
|
149 |
+
|
150 |
+
## How to run in `text-generation-webui`
|
151 |
+
|
152 |
+
Further instructions here: [text-generation-webui/docs/llama.cpp.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/llama.cpp.md).
|
153 |
+
|
154 |
+
## How to run from Python code
|
155 |
+
|
156 |
+
You can use GGUF models from Python using the [llama-cpp-python](https://github.com/abetlen/llama-cpp-python) or [ctransformers](https://github.com/marella/ctransformers) libraries.
|
157 |
+
|
158 |
+
### How to load this model in Python code, using ctransformers
|
159 |
+
|
160 |
+
#### First install the package
|
161 |
+
|
162 |
+
Run one of the following commands, according to your system:
|
163 |
+
|
164 |
+
```shell
|
165 |
+
# Base ctransformers with no GPU acceleration
|
166 |
+
pip install ctransformers
|
167 |
+
# Or with CUDA GPU acceleration
|
168 |
+
pip install ctransformers[cuda]
|
169 |
+
# Or with AMD ROCm GPU acceleration (Linux only)
|
170 |
+
CT_HIPBLAS=1 pip install ctransformers --no-binary ctransformers
|
171 |
+
# Or with Metal GPU acceleration for macOS systems only
|
172 |
+
CT_METAL=1 pip install ctransformers --no-binary ctransformers
|
173 |
+
```
|
174 |
+
|
175 |
+
#### Simple ctransformers example code
|
176 |
+
|
177 |
+
```python
|
178 |
+
from ctransformers import AutoModelForCausalLM
|
179 |
+
|
180 |
+
# Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
|
181 |
+
llm = AutoModelForCausalLM.from_pretrained("Ichsan2895/Merak-7B-v4-PROTOTYPE6-GGUF", model_file="Merak-7B-v4-PROTOTYPE6-model-q5_k_m.gguf", model_type="mistral", gpu_layers=50)
|
182 |
+
|
183 |
+
print(llm("AI is going to"))
|
184 |
+
```
|
185 |
+
|
186 |
+
## How to use with LangChain
|
187 |
+
|
188 |
+
Here are guides on using llama-cpp-python and ctransformers with LangChain:
|
189 |
+
|
190 |
+
* [LangChain + llama-cpp-python](https://python.langchain.com/docs/integrations/llms/llamacpp)
|
191 |
+
* [LangChain + ctransformers](https://python.langchain.com/docs/integrations/providers/ctransformers)
|
192 |
+
|
193 |
+
## CITATION
|
194 |
+
```
|
195 |
+
@software{lian2023mistralorca1
|
196 |
+
title = {MistralOrca: Mistral-7B Model Instruct-tuned on Filtered OpenOrcaV1 GPT-4 Dataset},
|
197 |
+
author = {Wing Lian and Bleys Goodson and Guan Wang and Eugene Pentland and Austin Cook and Chanvichet Vong and "Teknium"},
|
198 |
+
year = {2023},
|
199 |
+
publisher = {HuggingFace},
|
200 |
+
journal = {HuggingFace repository},
|
201 |
+
howpublished = {\url{https://huggingface.co/Open-Orca/Mistral-7B-OpenOrca},
|
202 |
+
}
|
203 |
+
|
204 |
+
@misc{mukherjee2023orca,
|
205 |
+
title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
|
206 |
+
author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
|
207 |
+
year={2023},
|
208 |
+
eprint={2306.02707},
|
209 |
+
archivePrefix={arXiv},
|
210 |
+
primaryClass={cs.CL}
|
211 |
+
}
|
212 |
+
|
213 |
+
@ONLINE{wikidump,
|
214 |
+
author = "Wikimedia Foundation",
|
215 |
+
title = "Wikimedia Downloads",
|
216 |
+
url = "https://dumps.wikimedia.org"
|
217 |
+
}
|
218 |
+
|
219 |
+
@inproceedings{wolf-etal-2020-transformers,
|
220 |
+
title = "Transformers: State-of-the-Art Natural Language Processing",
|
221 |
+
author = "Thomas Wolf and Lysandre Debut and Victor Sanh and Julien Chaumond and Clement Delangue and Anthony Moi and Pierric Cistac and Tim Rault and Rémi Louf and Morgan Funtowicz and Joe Davison and Sam Shleifer and Patrick von Platen and Clara Ma and Yacine Jernite and Julien Plu and Canwen Xu and Teven Le Scao and Sylvain Gugger and Mariama Drame and Quentin Lhoest and Alexander M. Rush",
|
222 |
+
booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations",
|
223 |
+
month = oct,
|
224 |
+
year = "2020",
|
225 |
+
address = "Online",
|
226 |
+
publisher = "Association for Computational Linguistics",
|
227 |
+
url = "https://www.aclweb.org/anthology/2020.emnlp-demos.6",
|
228 |
+
pages = "38--45"
|
229 |
+
}
|
230 |
+
|
231 |
+
@article{dettmers2023qlora,
|
232 |
+
title = {QLoRA: Efficient Finetuning of Quantized LLMs},
|
233 |
+
author = {Dettmers, Tim and Pagnoni, Artidoro and Holtzman, Ari and Zettlemoyer, Luke},
|
234 |
+
journal = {arXiv preprint arXiv:2305.14314},
|
235 |
+
year = {2023}
|
236 |
+
}
|
237 |
+
|
238 |
+
Special thanks to theBloke for his Readme.Md that We adopted in this model
|
239 |
+
```
|
240 |
+
[<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)
|
241 |
+
|
242 |
+
## HOW TO CITE THIS PROJECT
|
243 |
+
|
244 |
+
If you use the Merak-7B model in your research or project, please cite it as:
|
245 |
+
```
|
246 |
+
@article{Merak,
|
247 |
+
title={Merak-7B: The LLM for Bahasa Indonesia},
|
248 |
+
author={Muhammad Ichsan},
|
249 |
+
publisher={Hugging Face}
|
250 |
+
journal={Hugging Face Repository},
|
251 |
+
year={2023}
|
252 |
+
}
|
253 |
+
```
|