Instructions to use QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF:Q4_K_M
Use Docker
docker model run hf.co/QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF:Q4_K_M
- Ollama
How to use QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF with Ollama:
ollama run hf.co/QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF with Docker Model Runner:
docker model run hf.co/QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF:Q4_K_M
- Lemonade
How to use QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Llama-3-Alpha-Ko-8B-Instruct-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: llama3
|
| 4 |
+
language:
|
| 5 |
+
- ko
|
| 6 |
+
base_model: allganize/Llama-3-Alpha-Ko-8B-Instruct
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# QuantFactory/Llama-3-Alpha-Ko-8B-Instruct-GGUF
|
| 11 |
+
This is quantized version of [allganize/Llama-3-Alpha-Ko-8B-Instruct](https://huggingface.co/allganize/Llama-3-Alpha-Ko-8B-Instruct) created using llama.cpp
|
| 12 |
+
|
| 13 |
+
# Model Description
|
| 14 |
+
We are thrilled to introduce **Alpha-Instruct**, our latest language model, which demonstrates exceptional capabilities in both Korean and English. Alpha-Instruct is developed using the **Evolutionary Model Merging** technique, enabling it to excel in complex language tasks and logical reasoning.
|
| 15 |
+
|
| 16 |
+
A key aspect of Alpha-Instruct's development is our **community-based approach**. We draw inspiration and ideas from various communities, shaping our datasets, methodologies, and the model itself. In return, we are committed to sharing our insights with the community, providing detailed information on the data, methods, and models used in Alpha-Instruct's creation.
|
| 17 |
+
|
| 18 |
+
Alpha-Instruct has achieved outstanding performance on the **LogicKor, scoring an impressive 6.62**. Remarkably, this performance rivals that of 70B models, showcasing the efficiency and power of our 8B model. This achievement highlights Alpha-Instruct's advanced computational and reasoning skills, making it a leading choice for diverse and demanding language tasks.
|
| 19 |
+
|
| 20 |
+
**For more information and technical details about Alpha-Instruct, stay tuned to our updates and visit our [website](https://allganize-alpha.github.io/) (Soon).**
|
| 21 |
+
|
| 22 |
+
---
|
| 23 |
+
## Overview
|
| 24 |
+
Alpha-Instruct is our latest language model, developed using 'Evolutionary Model Merging' technique. This method employs a 1:1 ratio of task-specific datasets from KoBEST and Haerae, resulting in a model with named 'Alpha-Ko-8B-Evo'. The following models were used for merging:
|
| 25 |
+
- [Meta-Llama-3-8B](https://huggingface.co/meta-llama/Meta-Llama-3-8B) (Base)
|
| 26 |
+
- [Meta-Llama-3-8B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct) (Instruct)
|
| 27 |
+
- [Llama-3-Open-Ko-8B](beomi/Llama-3-Open-Ko-8B) (Continual Pretrained)
|
| 28 |
+
|
| 29 |
+
To refine and enhance Alpha-Instruct, we utilized a carefully curated high-quality datasets aimed at 'healing' the model's output, significantly boosting its human preference scores. We use [ORPO](https://arxiv.org/abs/2403.07691) specifically for this "healing" (RLHF) phase. The datasets* used include:
|
| 30 |
+
- [Korean-Human-Judgements](https://huggingface.co/datasets/HAERAE-HUB/Korean-Human-Judgements)
|
| 31 |
+
- [Orca-Math](https://huggingface.co/datasets/kuotient/orca-math-word-problems-193k-korean)
|
| 32 |
+
- [dpo-mix-7k](https://huggingface.co/datasets/argilla/dpo-mix-7k)
|
| 33 |
+
|
| 34 |
+
*Some of these datasets were partially used and translated for training, and we ensured there was no contamination during the evaluation process.
|
| 35 |
+
|
| 36 |
+
This approach effectively balances human preferences with the model's capabilities, making Alpha-Instruct well-suited for real-life scenarios where user satisfaction and performance are equally important.
|
| 37 |
+
|
| 38 |
+
## Benchmark Results
|
| 39 |
+
Results in [LogicKor](https://github.com/StableFluffy/LogicKor)* are as follows:
|
| 40 |
+
|
| 41 |
+
| Model | Single turn* | Multi turn* | Overall* |
|
| 42 |
+
|:------------------------------:|:------------:|:-----------:|:--------:|
|
| 43 |
+
| MLP-KTLim/llama-3-Korean-Bllossom-8B | 4.238 | 3.404 | 3.821 |
|
| 44 |
+
| Alpha-Ko-Evo | 5.143 | 5.238 | 5.190 |
|
| 45 |
+
| Alpha-Ko-Instruct (alt) | 7.095 | **6.571** | **6.833** |
|
| 46 |
+
| Alpha-Ko-Instruct | **7.143** | 6.065 | 6.620 |
|
| 47 |
+
| Alpha-Ko-Instruct-marlin (4bit) | 6.857 | 5.738 | 6.298 |
|
| 48 |
+
|
| 49 |
+
*Self report(Default settings with 'alpha' template, mean of 3).
|
| 50 |
+
|
| 51 |
+
Result in KoBEST(acc, num_shot=5) are as follows:
|
| 52 |
+
|
| 53 |
+
| Task | beomi/Llama-3-Open-Ko-8B-Instruct | maywell/Llama-3-Ko-8B-Instruct | **Alpha-Ko-Evo** | **Alpha-Ko-Instruct** |
|
| 54 |
+
| --- | --- | --- | --- | --- |
|
| 55 |
+
| kobest overall | 0.6220 | 0.6852 |0.7229|0.7055
|
| 56 |
+
| kobest_boolq| 0.6254 | 0.7208 | 0.8547 | 0.8369
|
| 57 |
+
| kobest_copa| 0.7110 | 0.7650 | 0.7420 | 0.7420
|
| 58 |
+
| kobest_hellaswag| 0.3840 | 0.4440 | 0.4220 | 0.4240
|
| 59 |
+
| kobest_sentineg| 0.8388 | 0.9194 |0.9471 | 0.9244
|
| 60 |
+
| kobest_wic| 0.5738| 0.6040 |0.6095 | 0.5730
|
| 61 |
+
|
| 62 |
+
*For reference, 'merged' models are chosen.
|
| 63 |
+
|
| 64 |
+
## How to use
|
| 65 |
+
|
| 66 |
+
```python
|
| 67 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 68 |
+
import torch
|
| 69 |
+
|
| 70 |
+
model_id = "allganize/Llama-3-Alpha-Ko-Instruct"
|
| 71 |
+
|
| 72 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 73 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 74 |
+
model_id,
|
| 75 |
+
torch_dtype="auto",
|
| 76 |
+
device_map="auto",
|
| 77 |
+
)
|
| 78 |
+
|
| 79 |
+
messages = [
|
| 80 |
+
{"role": "system", "content": "๋น์ ์ ์ธ๊ณต์ง๋ฅ ์ด์์คํดํธ์
๋๋ค. ๋ฌป๋ ๋ง์ ์น์ ํ๊ณ ์ ํํ๊ฒ ๋ต๋ณํ์ธ์."},
|
| 81 |
+
{"role": "user", "content": "ํผ๋ณด๋์น ์์ด์ด ๋ญ์ผ? ๊ทธ๋ฆฌ๊ณ ํผ๋ณด๋์น ์์ด์ ๋ํด ํ์ด์ฌ ์ฝ๋๋ฅผ ์ง์ค๋ณผ๋?"},
|
| 82 |
+
]
|
| 83 |
+
|
| 84 |
+
input_ids = tokenizer.apply_chat_template(
|
| 85 |
+
messages,
|
| 86 |
+
add_generation_prompt=True,
|
| 87 |
+
return_tensors="pt"
|
| 88 |
+
).to(model.device)
|
| 89 |
+
|
| 90 |
+
terminators = [
|
| 91 |
+
tokenizer.eos_token_id,
|
| 92 |
+
tokenizer.convert_tokens_to_ids("<|eot_id|>")
|
| 93 |
+
]
|
| 94 |
+
|
| 95 |
+
outputs = model.generate(
|
| 96 |
+
input_ids,
|
| 97 |
+
max_new_tokens=512,
|
| 98 |
+
eos_token_id=terminators,
|
| 99 |
+
do_sample=False,
|
| 100 |
+
repetition_penalty=1.05,
|
| 101 |
+
)
|
| 102 |
+
response = outputs[0][input_ids.shape[-1]:]
|
| 103 |
+
print(tokenizer.decode(response, skip_special_tokens=True))
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
## Correspondence to
|
| 107 |
+
- Ji soo Kim (jisoo.kim@allganize.ai)
|
| 108 |
+
- Contributors
|
| 109 |
+
- Sangmin Jeon (sangmin.jeon@allganize.ai)
|
| 110 |
+
- Seungwoo Ryu (seungwoo.ryu@allganize.ai)
|
| 111 |
+
|
| 112 |
+
## Special Thanks
|
| 113 |
+
- [@beomi](https://huggingface.co/beomi) for providing us with a great model!
|
| 114 |
+
|
| 115 |
+
## License
|
| 116 |
+
The use of this model is governed by the [META LLAMA 3 COMMUNITY LICENSE AGREEMENT](https://llama.meta.com/llama3/license/)
|