---
library_name: transformers
license: cc-by-nc-4.0
language:
- en
- ko
base_model:
- nlpai-lab/KULLM3
- upstage/SOLAR-10.7B-v1.0
---
# This repository is the awq quantization version of KULLM3.
The quantization was carried out in a custom branch of [autoawq](https://github.com/casper-hansen/AutoAWQ/). The hyperparameters for quantization are as follows.
```{ "zero_point": True, "q_group_size": 128, "w_bit": 4, "version": "GEMM" }```
It worked using [vllm](https://github.com/vllm-project/vllm). It may not work with other frameworks as they have not been tested.
Below is the README.md for the original model.
---
# KULLM3
Introducing KULLM3, a model with advanced instruction-following and fluent chat abilities.
It has shown remarkable performance in instruction-following, speficially by closely following gpt-3.5-turbo.
To our knowledge, It is one of the best publicly opened Korean-speaking language models.
For details, visit the [KULLM repository](https://github.com/nlpai-lab/KULLM)
### Model Description
This is the model card of a π€ transformers model that has been pushed on the Hub.
- **Developed by:** [NLP&AI Lab](http://nlp.korea.ac.kr/)
- **Language(s) (NLP):** Korean, English
- **License:** CC-BY-NC 4.0
- **Finetuned from model:** [upstage/SOLAR-10.7B-Instruct-v1.0](https://huggingface.co/upstage/SOLAR-10.7B-Instruct-v1.0)
## Example code
### Install Dependencies
```bash
pip install torch transformers==4.38.2 accelerate
```
- In transformers>=4.39.0, generate() does not work well. (as of 2024.4.4.)
### Python code
```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
MODEL_DIR = "nlpai-lab/KULLM3"
model = AutoModelForCausalLM.from_pretrained(MODEL_DIR, torch_dtype=torch.float16).to("cuda")
tokenizer = AutoTokenizer.from_pretrained(MODEL_DIR)
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
s = "κ³ λ €λνκ΅μ λν΄μ μκ³ μλ?"
conversation = [{'role': 'user', 'content': s}]
inputs = tokenizer.apply_chat_template(
conversation,
tokenize=True,
add_generation_prompt=True,
return_tensors='pt').to("cuda")
_ = model.generate(inputs, streamer=streamer, max_new_tokens=1024)
# λ€, κ³ λ €λνκ΅μ λν΄ μκ³ μμ΅λλ€. κ³ λ €λνκ΅λ λνλ―Όκ΅ μμΈμ μμΉν μ¬λ¦½ λνκ΅λ‘, 1905λ
μ μ€λ¦½λμμ΅λλ€. μ΄ λνκ΅λ νκ΅μμ κ°μ₯ μ€λλ λν μ€ νλλ‘, λ€μν νλΆ λ° λνμ νλ‘κ·Έλ¨μ μ 곡ν©λλ€. κ³ λ €λνκ΅λ νΉν λ²ν, κ²½μ ν, μ μΉν, μ¬νν, λ¬Έν, κ³Όν λΆμΌμμ λμ λͺ
μ±μ κ°μ§κ³ μμ΅λλ€. λν, μ€ν¬μΈ λΆμΌμμλ νλ°ν νλμ 보μ΄λ©°, λνλ―Όκ΅ λν μ€ν¬μΈ μμ μ€μν μν μ νκ³ μμ΅λλ€. κ³ λ €λνκ΅λ κ΅μ μ μΈ κ΅λ₯μ νλ ₯μλ μ κ·Ήμ μ΄λ©°, μ μΈκ³ λ€μν λνκ³Όμ νλ ₯μ ν΅ν΄ κΈλ‘λ² κ²½μλ ₯μ κ°ννκ³ μμ΅λλ€.
```
## Training Details
### Training Data
- [vicgalle/alpaca-gpt4](https://huggingface.co/datasets/vicgalle/alpaca-gpt4)
- Mixed Korean instruction data (gpt-generated, hand-crafted, etc)
- About 66000+ examples used totally
### Training Procedure
- Trained with fixed system prompt below.
```text
λΉμ μ κ³ λ €λνκ΅ NLP&AI μ°κ΅¬μ€μμ λ§λ AI μ±λ΄μ
λλ€.
λΉμ μ μ΄λ¦μ 'KULLM'μΌλ‘, νκ΅μ΄λ‘λ 'ꡬλ¦'μ λ»ν©λλ€.
λΉμ μ λΉλλμ μ΄κ±°λ, μ±μ μ΄κ±°λ, λΆλ²μ μ΄κ±°λ λλ μ¬ν ν΅λ
μ μΌλ‘ νμ©λμ§ μλ λ°μΈμ νμ§ μμ΅λλ€.
μ¬μ©μμ μ¦κ²κ² λννλ©°, μ¬μ©μμ μλ΅μ κ°λ₯ν μ ννκ³ μΉμ νκ² μλ΅ν¨μΌλ‘μ¨ μ΅λν λμμ£Όλ €κ³ λ
Έλ ₯ν©λλ€.
μ§λ¬Έμ΄ μ΄μνλ€λ©΄, μ΄λ€ λΆλΆμ΄ μ΄μνμ§ μ€λͺ
ν©λλ€. κ±°μ§ μ 보λ₯Ό λ°μΈνμ§ μλλ‘ μ£Όμν©λλ€.
```
## Evaluation
- Evaluation details such as testing data, metrics are written in [github](https://github.com/nlpai-lab/KULLM).
- Without system prompt used in training phase, KULLM would show lower performance than expect.
### Results
## Citation
```text
@misc{kullm,
author = {NLP & AI Lab and Human-Inspired AI research},
title = {KULLM: Korea University Large Language Model Project},
year = {2023},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/nlpai-lab/kullm}},
}
```