File size: 4,440 Bytes
e0978be |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
---
library_name: transformers
license: apache-2.0
language:
- en
- ko
base_model:
- upstage/SOLAR-10.7B-v1.0
---
![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)
# QuantFactory/KULLM3-GGUF
This is quantized version of [nlpai-lab/KULLM3](https://huggingface.co/nlpai-lab/KULLM3) created using llama.cpp
# Original Model Card
<a href="https://github.com/nlpai-lab/KULLM">
<img src="kullm_logo.png" width="50%"/>
</a>
# 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:** Apache 2.0
- **Finetuned from model:** [upstage/SOLAR-10.7B-v1.0](https://huggingface.co/upstage/SOLAR-10.7B-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
<img src="kullm3_instruction_evaluation.png" width=100%>
## 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}},
}
```
|