RichardErkhov
commited on
Commit
β’
a7808b2
1
Parent(s):
1e447b4
uploaded readme
Browse files
README.md
ADDED
@@ -0,0 +1,379 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Quantization made by Richard Erkhov.
|
2 |
+
|
3 |
+
[Github](https://github.com/RichardErkhov)
|
4 |
+
|
5 |
+
[Discord](https://discord.gg/pvy7H8DZMG)
|
6 |
+
|
7 |
+
[Request more models](https://github.com/RichardErkhov/quant_request)
|
8 |
+
|
9 |
+
|
10 |
+
llama-3-Korean-Bllossom-8B - GGUF
|
11 |
+
- Model creator: https://huggingface.co/MLP-KTLim/
|
12 |
+
- Original model: https://huggingface.co/MLP-KTLim/llama-3-Korean-Bllossom-8B/
|
13 |
+
|
14 |
+
|
15 |
+
| Name | Quant method | Size |
|
16 |
+
| ---- | ---- | ---- |
|
17 |
+
| [llama-3-Korean-Bllossom-8B.Q2_K.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.Q2_K.gguf) | Q2_K | 2.96GB |
|
18 |
+
| [llama-3-Korean-Bllossom-8B.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.IQ3_XS.gguf) | IQ3_XS | 3.28GB |
|
19 |
+
| [llama-3-Korean-Bllossom-8B.IQ3_S.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.IQ3_S.gguf) | IQ3_S | 3.43GB |
|
20 |
+
| [llama-3-Korean-Bllossom-8B.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.Q3_K_S.gguf) | Q3_K_S | 3.41GB |
|
21 |
+
| [llama-3-Korean-Bllossom-8B.IQ3_M.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.IQ3_M.gguf) | IQ3_M | 3.52GB |
|
22 |
+
| [llama-3-Korean-Bllossom-8B.Q3_K.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.Q3_K.gguf) | Q3_K | 3.74GB |
|
23 |
+
| [llama-3-Korean-Bllossom-8B.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.Q3_K_M.gguf) | Q3_K_M | 3.74GB |
|
24 |
+
| [llama-3-Korean-Bllossom-8B.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.Q3_K_L.gguf) | Q3_K_L | 4.03GB |
|
25 |
+
| [llama-3-Korean-Bllossom-8B.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.IQ4_XS.gguf) | IQ4_XS | 4.18GB |
|
26 |
+
| [llama-3-Korean-Bllossom-8B.Q4_0.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.Q4_0.gguf) | Q4_0 | 4.34GB |
|
27 |
+
| [llama-3-Korean-Bllossom-8B.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.IQ4_NL.gguf) | IQ4_NL | 4.38GB |
|
28 |
+
| [llama-3-Korean-Bllossom-8B.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.Q4_K_S.gguf) | Q4_K_S | 4.37GB |
|
29 |
+
| [llama-3-Korean-Bllossom-8B.Q4_K.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.Q4_K.gguf) | Q4_K | 4.58GB |
|
30 |
+
| [llama-3-Korean-Bllossom-8B.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.Q4_K_M.gguf) | Q4_K_M | 4.58GB |
|
31 |
+
| [llama-3-Korean-Bllossom-8B.Q4_1.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.Q4_1.gguf) | Q4_1 | 4.78GB |
|
32 |
+
| [llama-3-Korean-Bllossom-8B.Q5_0.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.Q5_0.gguf) | Q5_0 | 5.21GB |
|
33 |
+
| [llama-3-Korean-Bllossom-8B.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.Q5_K_S.gguf) | Q5_K_S | 5.21GB |
|
34 |
+
| [llama-3-Korean-Bllossom-8B.Q5_K.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.Q5_K.gguf) | Q5_K | 5.34GB |
|
35 |
+
| [llama-3-Korean-Bllossom-8B.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.Q5_K_M.gguf) | Q5_K_M | 5.34GB |
|
36 |
+
| [llama-3-Korean-Bllossom-8B.Q5_1.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.Q5_1.gguf) | Q5_1 | 5.65GB |
|
37 |
+
| [llama-3-Korean-Bllossom-8B.Q6_K.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.Q6_K.gguf) | Q6_K | 6.14GB |
|
38 |
+
| [llama-3-Korean-Bllossom-8B.Q8_0.gguf](https://huggingface.co/RichardErkhov/MLP-KTLim_-_llama-3-Korean-Bllossom-8B-gguf/blob/main/llama-3-Korean-Bllossom-8B.Q8_0.gguf) | Q8_0 | 7.95GB |
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
|
43 |
+
Original model description:
|
44 |
+
---
|
45 |
+
base_model:
|
46 |
+
- meta-llama/Meta-Llama-3-8B
|
47 |
+
language:
|
48 |
+
- en
|
49 |
+
- ko
|
50 |
+
library_name: transformers
|
51 |
+
license: llama3
|
52 |
+
---
|
53 |
+
|
54 |
+
<a href="https://github.com/MLP-Lab/Bllossom">
|
55 |
+
<img src="https://github.com/teddysum/bllossom/blob/main//bllossom_icon.png?raw=true" width="40%" height="50%">
|
56 |
+
</a>
|
57 |
+
|
58 |
+
|
59 |
+
|
60 |
+
# Update!
|
61 |
+
* ~~[2024.08.09] Llama3.1 λ²μ μ κΈ°λ°μΌλ‘ν Bllossom-8Bλ‘ λͺ¨λΈμ μ
λ°μ΄νΈ νμ΅λλ€. κΈ°μ‘΄ llama3κΈ°λ° Bllossom λ³΄λ€ νκ· 5%μ λ μ±λ₯ ν₯μμ΄ μμμ΅λλ€.~~(μμ μ€μ μμ΅λλ€.)
|
62 |
+
* [2024.06.18] μ¬μ νμ΅λμ **250GB**κΉμ§ λλ¦° Bllossom ELOλͺ¨λΈλ‘ μ
λ°μ΄νΈ λμμ΅λλ€. λ€λ§ λ¨μ΄νμ₯μ νμ§ μμμ΅λλ€. κΈ°μ‘΄ λ¨μ΄νμ₯λ long-context λͺ¨λΈμ νμ©νκ³ μΆμΌμ λΆμ κ°μΈμ°λ½μ£ΌμΈμ!
|
63 |
+
* [2024.06.18] Bllossom ELO λͺ¨λΈμ μ체 κ°λ°ν ELOμ¬μ νμ΅ κΈ°λ°μΌλ‘ μλ‘μ΄ νμ΅λ λͺ¨λΈμ
λλ€. [LogicKor](https://github.com/StableFluffy/LogicKor) λ²€μΉλ§ν¬ κ²°κ³Ό νμ‘΄νλ νκ΅μ΄ 10Bμ΄ν λͺ¨λΈμ€ SOTAμ μλ₯Ό λ°μμ΅λλ€.
|
64 |
+
|
65 |
+
LogicKor μ±λ₯ν :
|
66 |
+
| Model | Math | Reasoning | Writing | Coding | Understanding | Grammar | Single ALL | Multi ALL | Overall |
|
67 |
+
|:---------:|:-----:|:------:|:-----:|:-----:|:----:|:-----:|:-----:|:-----:|:----:|
|
68 |
+
| gpt-3.5-turbo-0125 | 7.14 | 7.71 | 8.28 | 5.85 | 9.71 | 6.28 | 7.50 | 7.95 | 7.72 |
|
69 |
+
| gemini-1.5-pro-preview-0215 | 8.00 | 7.85 | 8.14 | 7.71 | 8.42 | 7.28 | 7.90 | 6.26 | 7.08 |
|
70 |
+
| llama-3-Korean-Bllossom-8B | 5.43 | 8.29 | 9.0 | 4.43 | 7.57 | 6.86 | 6.93 | 6.93 | 6.93 |
|
71 |
+
|
72 |
+
|
73 |
+
|
74 |
+
# Bllossom | [Demo]() | [Homepage](https://www.bllossom.ai/) | [Github](https://github.com/MLP-Lab/Bllossom) |
|
75 |
+
|
76 |
+
<!-- [GPUμ© Colab μ½λμμ ](https://colab.research.google.com/drive/1fBOzUVZ6NRKk_ugeoTbAOokWKqSN47IG?usp=sharing) | -->
|
77 |
+
<!-- [CPUμ© Colab μμνλͺ¨λΈ μ½λμμ ](https://colab.research.google.com/drive/129ZNVg5R2NPghUEFHKF0BRdxsZxinQcJ?usp=drive_link) -->
|
78 |
+
|
79 |
+
```bash
|
80 |
+
μ ν¬ Bllossomν μμ νκ΅μ΄-μμ΄ μ΄μ€ μΈμ΄λͺ¨λΈμΈ Bllossomμ 곡κ°νμ΅λλ€!
|
81 |
+
μμΈκ³ΌκΈ°λ μνΌμ»΄ν¨ν
μΌν°μ μ§μμΌλ‘ 100GBκ°λλ νκ΅μ΄λ‘ λͺ¨λΈμ 체λ₯Ό ννλν νκ΅μ΄ κ°ν μ΄μ€μΈμ΄ λͺ¨λΈμ
λλ€!
|
82 |
+
νκ΅μ΄ μνλ λͺ¨λΈ μ°Ύκ³ μμ§ μμΌμ
¨λμ?
|
83 |
+
- νκ΅μ΄ μ΅μ΄! λ¬΄λ € 3λ§κ°κ° λλ νκ΅μ΄ μ΄ννμ₯
|
84 |
+
- Llama3λλΉ λλ΅ 25% λ κΈ΄ κΈΈμ΄μ νκ΅μ΄ Context μ²λ¦¬κ°λ₯
|
85 |
+
- νκ΅μ΄-μμ΄ Pararell Corpusλ₯Ό νμ©ν νκ΅μ΄-μμ΄ μ§μμ°κ²° (μ¬μ νμ΅)
|
86 |
+
- νκ΅μ΄ λ¬Έν, μΈμ΄λ₯Ό κ³ λ €ν΄ μΈμ΄νμκ° μ μν λ°μ΄ν°λ₯Ό νμ©ν λ―ΈμΈμ‘°μ
|
87 |
+
- κ°ννμ΅
|
88 |
+
μ΄ λͺ¨λ κ² νκΊΌλ²μ μ μ©λκ³ μμ
μ μ΄μ©μ΄ κ°λ₯ν Bllossomμ μ΄μ©ν΄ μ¬λ¬λΆ λ§μ λͺ¨λΈμ λ§λ€μ΄λ³΄μΈμ₯!
|
89 |
+
λ¬΄λ € Colab λ¬΄λ£ GPUλ‘ νμ΅μ΄ κ°λ₯ν©λλ€. νΉμ μμν λͺ¨λΈλ‘ CPUμμ¬λ €λ³΄μΈμ [μμνλͺ¨λΈ](https://huggingface.co/MLP-KTLim/llama-3-Korean-Bllossom-8B-4bit)
|
90 |
+
|
91 |
+
1. Bllossom-8Bλ μμΈκ³ΌκΈ°λ, ν
λμΈ, μ°μΈλ μΈμ΄μμ μ°κ΅¬μ€μ μΈμ΄νμμ νμ
ν΄ λ§λ μ€μ©μ£ΌμκΈ°λ° μΈμ΄λͺ¨λΈμ
λλ€! μμΌλ‘ μ§μμ μΈ μ
λ°μ΄νΈλ₯Ό ν΅ν΄ κ΄λ¦¬νκ² μ΅λλ€ λ§μ΄ νμ©ν΄μ£ΌμΈμ π
|
92 |
+
2. μ΄ κ°λ ₯ν Advanced-Bllossom 8B, 70Bλͺ¨λΈ, μκ°-μΈμ΄λͺ¨λΈμ 보μ νκ³ μμ΅λλ€! (κΆκΈνμ λΆμ κ°λ³ μ°λ½μ£ΌμΈμ!!)
|
93 |
+
3. Bllossomμ NAACL2024, LREC-COLING2024 (ꡬλ) λ°νλ‘ μ±νλμμ΅λλ€.
|
94 |
+
4. μ’μ μΈμ΄λͺ¨λΈ κ³μ μ
λ°μ΄νΈ νκ² μ΅λλ€!! νκ΅μ΄ κ°νλ₯Όμν΄ κ³΅λ μ°κ΅¬νμ€λΆ(νΉνλ
Όλ¬Έ) μΈμ λ νμν©λλ€!!
|
95 |
+
νΉν μλμ GPUλΌλ λμ¬ κ°λ₯ννμ μΈμ λ μ°λ½μ£ΌμΈμ! λ§λ€κ³ μΆμκ±° λμλλ €μ.
|
96 |
+
```
|
97 |
+
|
98 |
+
The Bllossom language model is a Korean-English bilingual language model based on the open-source LLama3. It enhances the connection of knowledge between Korean and English. It has the following features:
|
99 |
+
|
100 |
+
* **Knowledge Linking**: Linking Korean and English knowledge through additional training
|
101 |
+
* **Vocabulary Expansion**: Expansion of Korean vocabulary to enhance Korean expressiveness.
|
102 |
+
* **Instruction Tuning**: Tuning using custom-made instruction following data specialized for Korean language and Korean culture
|
103 |
+
* **Human Feedback**: DPO has been applied
|
104 |
+
* **Vision-Language Alignment**: Aligning the vision transformer with this language model
|
105 |
+
|
106 |
+
**This model developed by [MLPLab at Seoultech](http://mlp.seoultech.ac.kr), [Teddysum](http://teddysum.ai/) and [Yonsei Univ](https://sites.google.com/view/hansaemkim/hansaem-kim)**
|
107 |
+
|
108 |
+
## Demo Video
|
109 |
+
|
110 |
+
<div style="display: flex; justify-content: space-between;">
|
111 |
+
<!-- 첫 λ²μ§Έ μ»¬λΌ -->
|
112 |
+
<div style="width: 49%;">
|
113 |
+
<a>
|
114 |
+
<img src="https://github.com/lhsstn/lhsstn/blob/main/x-llava_dem.gif?raw=true" style="width: 100%; height: auto;">
|
115 |
+
</a>
|
116 |
+
<p style="text-align: center;">Bllossom-V Demo</p>
|
117 |
+
</div>
|
118 |
+
|
119 |
+
<!-- λ λ²μ§Έ μ»¬λΌ (νμνλ€λ©΄) -->
|
120 |
+
<div style="width: 49%;">
|
121 |
+
<a>
|
122 |
+
<img src="https://github.com/lhsstn/lhsstn/blob/main/bllossom_demo_kakao.gif?raw=true" style="width: 70%; height: auto;">
|
123 |
+
</a>
|
124 |
+
<p style="text-align: center;">Bllossom Demo(Kakao)γ
€γ
€γ
€γ
€γ
€γ
€γ
€γ
€</p>
|
125 |
+
</div>
|
126 |
+
</div>
|
127 |
+
|
128 |
+
|
129 |
+
|
130 |
+
# NEWS
|
131 |
+
* [2024.06.18] We have reverted to the non-vocab-expansion model. However, we have significantly increased the amount of pre-training data to 250GB.
|
132 |
+
* [2024.05.08] Vocab Expansion Model Update
|
133 |
+
* [2024.04.25] We released Bllossom v2.0, based on llama-3
|
134 |
+
|
135 |
+
## Example code
|
136 |
+
|
137 |
+
### Colab Tutorial
|
138 |
+
- [Inference-Code-Link](https://colab.research.google.com/drive/1fBOzUVZ6NRKk_ugeoTbAOokWKqSN47IG?usp=sharing)
|
139 |
+
|
140 |
+
### Install Dependencies
|
141 |
+
```bash
|
142 |
+
pip install torch transformers==4.40.0 accelerate
|
143 |
+
```
|
144 |
+
|
145 |
+
### Python code with Pipeline
|
146 |
+
```python
|
147 |
+
import transformers
|
148 |
+
import torch
|
149 |
+
|
150 |
+
model_id = "MLP-KTLim/llama-3-Korean-Bllossom-8B"
|
151 |
+
|
152 |
+
pipeline = transformers.pipeline(
|
153 |
+
"text-generation",
|
154 |
+
model=model_id,
|
155 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
156 |
+
device_map="auto",
|
157 |
+
)
|
158 |
+
|
159 |
+
pipeline.model.eval()
|
160 |
+
|
161 |
+
PROMPT = '''You are a helpful AI assistant. Please answer the user's questions kindly. λΉμ μ μ λ₯ν AI μ΄μμ€ν΄νΈ μ
λλ€. μ¬μ©μμ μ§λ¬Έμ λν΄ μΉμ νκ² λ΅λ³ν΄μ£ΌμΈμ.'''
|
162 |
+
instruction = "μμΈμ μ λͺ
ν κ΄κ΄ μ½μ€λ₯Ό λ§λ€μ΄μ€λ?"
|
163 |
+
|
164 |
+
messages = [
|
165 |
+
{"role": "system", "content": f"{PROMPT}"},
|
166 |
+
{"role": "user", "content": f"{instruction}"}
|
167 |
+
]
|
168 |
+
|
169 |
+
prompt = pipeline.tokenizer.apply_chat_template(
|
170 |
+
messages,
|
171 |
+
tokenize=False,
|
172 |
+
add_generation_prompt=True
|
173 |
+
)
|
174 |
+
|
175 |
+
terminators = [
|
176 |
+
pipeline.tokenizer.eos_token_id,
|
177 |
+
pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
|
178 |
+
]
|
179 |
+
|
180 |
+
outputs = pipeline(
|
181 |
+
prompt,
|
182 |
+
max_new_tokens=2048,
|
183 |
+
eos_token_id=terminators,
|
184 |
+
do_sample=True,
|
185 |
+
temperature=0.6,
|
186 |
+
top_p=0.9
|
187 |
+
)
|
188 |
+
|
189 |
+
print(outputs[0]["generated_text"][len(prompt):])
|
190 |
+
```
|
191 |
+
```
|
192 |
+
# λ¬Όλ‘ μ΄μ£ ! μμΈμ λ€μν λ¬Ένμ μμ¬, μμ°μ κ²ΈλΉν λμλ‘, λ§μ κ΄κ΄ λͺ
μλ₯Ό μλν©λλ€. μ¬κΈ° μμΈμ μ λͺ
ν κ΄κ΄ μ½μ€λ₯Ό μκ°ν΄ λ릴κ²μ.
|
193 |
+
|
194 |
+
### μ½μ€ 1: μμ¬μ λ¬Έν νλ°©
|
195 |
+
|
196 |
+
1. **경볡κΆ**
|
197 |
+
- μμΈμ λνμ μΈ κΆκΆλ‘, μ‘°μ μμ‘°μ μμ¬μ λ¬Ένλ₯Ό 체νν μ μλ κ³³μ
λλ€.
|
198 |
+
|
199 |
+
2. **λΆμ΄ νμ₯λ§μ**
|
200 |
+
- μ ν΅ νμ₯μ΄ μ 보쑴λ λ§μλ‘, μ‘°μ μλμ μνμμ λλ μ μμ΅λλ€.
|
201 |
+
|
202 |
+
3. **μΈμ¬λ**
|
203 |
+
- μ ν΅ λ¬Ένμ νλ μμ μ΄ κ³΅μ‘΄νλ 거리λ‘, λ€μν κ°€λ¬λ¦¬μ μ ν΅ μμμ μ΄ μμ΅λλ€.
|
204 |
+
|
205 |
+
4. **μ²κ³μ²**
|
206 |
+
- μμΈμ μ€μ¬μ μμΉν μ²λ¬ΈμΌλ‘, μ‘°κΉ
κ³Ό μ°μ±
μ μ¦κΈΈ μ μλ κ³³μ
λλ€.
|
207 |
+
|
208 |
+
### μ½μ€ 2: μμ°κ³Ό μΌν
|
209 |
+
|
210 |
+
1. **λ¨μ° μμΈνμ**
|
211 |
+
- μμΈμ μ κ²½μ νλμ λ³Ό μ μλ κ³³μΌλ‘, νΉν μ λ
μκ°λμ μΌλͺ°μ κ°μνλ κ²μ΄ μ’μ΅λλ€.
|
212 |
+
|
213 |
+
2. **λͺ
λ**
|
214 |
+
- μΌνκ³Ό μμμ μ΄ μ¦λΉν μ§μμΌλ‘, λ€μν λΈλλμ μ ν΅ μμμ λ§λ³Ό μ μμ΅λλ€.
|
215 |
+
|
216 |
+
3. **νκ°κ³΅μ**
|
217 |
+
- μμΈμ μ£Όμ 곡μ μ€ νλλ‘, μ‘°κΉ
, μμ κ±° νκΈ°, λ°°λ μ¬νμ μ¦κΈΈ μ μμ΅λλ€.
|
218 |
+
|
219 |
+
4. **νλ**
|
220 |
+
- μ μμ΄λ€μ΄ μ¦κ²¨ μ°Ύλ μ§μμΌλ‘, λ€μν μΉ΄ν, λ μ€ν λ, ν΄λ½μ΄ μμ΅λλ€.
|
221 |
+
|
222 |
+
### μ½μ€ 3: νλμ μ ν΅μ μ‘°ν
|
223 |
+
|
224 |
+
1. **λλλ¬Έ λμμΈ νλΌμ (DDP)**
|
225 |
+
- νλμ μΈ κ±΄μΆλ¬Όλ‘, λ€μν μ μμ μ΄λ²€νΈκ° μ΄λ¦¬λ κ³³μ
λλ€.
|
226 |
+
|
227 |
+
2. **μ΄νμ**
|
228 |
+
- λ€μν κ΅μ μμκ³Ό μΉ΄νκ° μλ μ§μμΌλ‘, λ€μν λ¬Ένλ₯Ό κ²½νν μ μμ΅λλ€.
|
229 |
+
|
230 |
+
3. **κ΄νλ¬Έ**
|
231 |
+
- μμΈμ μ€μ¬μ μμΉν κ΄μ₯μΌλ‘, λ€μν 곡μ°κ³Ό νμ¬κ° μ΄λ¦½λλ€.
|
232 |
+
|
233 |
+
4. **μμΈλλ**
|
234 |
+
- μμΈ μΈκ³½μ μμΉν ν
λ§νν¬λ‘, κ°μ‘±λ¨μ κ΄κ΄κ°λ€μκ² μΈκΈ° μλ κ³³μ
λλ€.
|
235 |
+
|
236 |
+
μ΄ μ½μ€λ€μ μμΈμ λ€μν λ©΄λͺ¨λ₯Ό κ²½νν μ μλλ‘ κ΅¬μ±λμ΄ μμ΅λλ€. κ° μ½μ€λ§λ€ μκ°μ μ‘°μ νκ³ , κ°μΈμ κ΄μ¬μ¬μ λ§κ² μ ννμ¬ λ°©λ¬Ένλ©΄ μ’μ κ² κ°μ΅λλ€. μ¦κ±°μ΄ μ¬ν λμΈμ!
|
237 |
+
```
|
238 |
+
|
239 |
+
### Python code with AutoModel
|
240 |
+
```python
|
241 |
+
|
242 |
+
import os
|
243 |
+
import torch
|
244 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
245 |
+
|
246 |
+
model_id = 'MLP-KTLim/llama-3-Korean-Bllossom-8B'
|
247 |
+
|
248 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
249 |
+
model = AutoModelForCausalLM.from_pretrained(
|
250 |
+
model_id,
|
251 |
+
torch_dtype=torch.bfloat16,
|
252 |
+
device_map="auto",
|
253 |
+
)
|
254 |
+
|
255 |
+
model.eval()
|
256 |
+
|
257 |
+
PROMPT = '''You are a helpful AI assistant. Please answer the user's questions kindly. λΉμ μ μ λ₯ν AI μ΄μμ€ν΄νΈ μ
λλ€. μ¬μ©μμ μ§λ¬Έμ λν΄ μΉμ νκ² λ΅λ³ν΄μ£ΌμΈμ.'''
|
258 |
+
instruction = "μμΈμ μ λͺ
ν κ΄κ΄ μ½μ€λ₯Ό λ§λ€μ΄μ€λ?"
|
259 |
+
|
260 |
+
messages = [
|
261 |
+
{"role": "system", "content": f"{PROMPT}"},
|
262 |
+
{"role": "user", "content": f"{instruction}"}
|
263 |
+
]
|
264 |
+
|
265 |
+
input_ids = tokenizer.apply_chat_template(
|
266 |
+
messages,
|
267 |
+
add_generation_prompt=True,
|
268 |
+
return_tensors="pt"
|
269 |
+
).to(model.device)
|
270 |
+
|
271 |
+
terminators = [
|
272 |
+
tokenizer.eos_token_id,
|
273 |
+
tokenizer.convert_tokens_to_ids("<|eot_id|>")
|
274 |
+
]
|
275 |
+
|
276 |
+
outputs = model.generate(
|
277 |
+
input_ids,
|
278 |
+
max_new_tokens=2048,
|
279 |
+
eos_token_id=terminators,
|
280 |
+
do_sample=True,
|
281 |
+
temperature=0.6,
|
282 |
+
top_p=0.9
|
283 |
+
)
|
284 |
+
|
285 |
+
print(tokenizer.decode(outputs[0][input_ids.shape[-1]:], skip_special_tokens=True))
|
286 |
+
```
|
287 |
+
```
|
288 |
+
# λ¬Όλ‘ μ΄μ£ ! μμΈμ λ€μν λ¬Ένμ μμ¬, μμ°μ κ²ΈλΉν λμλ‘, λ§μ κ΄κ΄ λͺ
μλ₯Ό μλν©λλ€. μ¬κΈ° μμΈμ μ λͺ
ν κ΄κ΄ μ½μ€λ₯Ό μκ°ν΄ λ릴κ²μ.
|
289 |
+
|
290 |
+
### μ½μ€ 1: μμ¬μ λ¬Έν νλ°©
|
291 |
+
|
292 |
+
1. **경볡κΆ**
|
293 |
+
- μμΈμ λνμ μΈ κΆκΆλ‘, μ‘°μ μμ‘°μ μμ¬μ λ¬Ένλ₯Ό 체νν μ μλ κ³³μ
λλ€.
|
294 |
+
|
295 |
+
2. **λΆμ΄ νμ₯λ§μ**
|
296 |
+
- μ ν΅ νμ₯μ΄ μ 보쑴λ λ§μλ‘, μ‘°μ μλμ μνμμ λλ μ μμ΅λλ€.
|
297 |
+
|
298 |
+
3. **μΈμ¬λ**
|
299 |
+
- μ ν΅ λ¬Ένμ νλ μμ μ΄ κ³΅μ‘΄νλ 거리λ‘, λ€μν κ°€λ¬λ¦¬μ μ ν΅ μμμ μ΄ μμ΅λλ€.
|
300 |
+
|
301 |
+
4. **μ²κ³μ²**
|
302 |
+
- μμΈμ μ€μ¬μ μμΉν μ²λ¬ΈμΌλ‘, μ‘°κΉ
κ³Ό μ°μ±
μ μ¦κΈΈ μ μλ κ³³μ
λλ€.
|
303 |
+
|
304 |
+
### μ½μ€ 2: μμ°κ³Ό μΌν
|
305 |
+
|
306 |
+
1. **λ¨μ° μμΈνμ**
|
307 |
+
- μμΈμ μ κ²½μ νλμ λ³Ό μ μλ κ³³μΌλ‘, νΉν μ λ
μκ°λμ μΌλͺ°μ κ°μνλ κ²μ΄ μ’μ΅λλ€.
|
308 |
+
|
309 |
+
2. **λͺ
λ**
|
310 |
+
- μΌνκ³Ό μμμ μ΄ μ¦λΉν μ§μμΌλ‘, λ€μν λΈλλμ μ ν΅ μμμ λ§λ³Ό μ μμ΅λλ€.
|
311 |
+
|
312 |
+
3. **νκ°κ³΅μ**
|
313 |
+
- μμΈμ μ£Όμ 곡μ μ€ νλλ‘, μ‘°κΉ
, μμ κ±° νκΈ°, λ°°λ μ¬νμ μ¦κΈΈ μ μμ΅λλ€.
|
314 |
+
|
315 |
+
4. **νλ**
|
316 |
+
- μ μμ΄λ€μ΄ μ¦κ²¨ μ°Ύλ μ§μμΌλ‘, λ€μν μΉ΄ν, λ μ€ν λ, ν΄λ½μ΄ μμ΅λλ€.
|
317 |
+
|
318 |
+
### μ½μ€ 3: νλμ μ ν΅μ μ‘°ν
|
319 |
+
|
320 |
+
1. **λλλ¬Έ λμμΈ νλΌμ (DDP)**
|
321 |
+
- νλμ μΈ κ±΄μΆλ¬Όλ‘, λ€μν μ μμ μ΄λ²€νΈκ° μ΄λ¦¬λ κ³³μ
λλ€.
|
322 |
+
|
323 |
+
2. **μ΄νμ**
|
324 |
+
- λ€μν κ΅μ μμκ³Ό μΉ΄νκ° μλ μ§μμΌλ‘, λ€μν λ¬Ένλ₯Ό κ²½νν μ μμ΅λλ€.
|
325 |
+
|
326 |
+
3. **κ΄νλ¬Έ**
|
327 |
+
- μμΈμ μ€μ¬μ μμΉν κ΄μ₯μΌλ‘, λ€μν 곡μ°κ³Ό νμ¬κ° μ΄λ¦½λλ€.
|
328 |
+
|
329 |
+
4. **μμΈλλ**
|
330 |
+
- μμΈ μΈκ³½μ μμΉν ν
λ§νν¬λ‘, κ°μ‘±λ¨μ κ΄κ΄κ°λ€μκ² μΈκΈ° μλ κ³³μ
λλ€.
|
331 |
+
|
332 |
+
μ΄ μ½μ€λ€μ μμΈμ λ€μν λ©΄λͺ¨λ₯Ό κ²½νν μ μλλ‘ κ΅¬μ±λμ΄ μμ΅λλ€. κ° μ½μ€λ§λ€ μκ°μ μ‘°μ νκ³ , κ°μΈμ κ΄μ¬μ¬μ λ§κ² μ ννμ¬ λ°©λ¬Ένλ©΄ μ’μ κ² κ°μ΅λλ€. μ¦κ±°μ΄ μ¬ν λμΈμ!
|
333 |
+
```
|
334 |
+
|
335 |
+
|
336 |
+
|
337 |
+
## Citation
|
338 |
+
**Language Model**
|
339 |
+
```text
|
340 |
+
@misc{bllossom,
|
341 |
+
author = {ChangSu Choi, Yongbin Jeong, Seoyoon Park, InHo Won, HyeonSeok Lim, SangMin Kim, Yejee Kang, Chanhyuk Yoon, Jaewan Park, Yiseul Lee, HyeJin Lee, Younggyun Hahm, Hansaem Kim, KyungTae Lim},
|
342 |
+
title = {Optimizing Language Augmentation for Multilingual Large Language Models: A Case Study on Korean},
|
343 |
+
year = {2024},
|
344 |
+
journal = {LREC-COLING 2024},
|
345 |
+
paperLink = {\url{https://arxiv.org/pdf/2403.10882}},
|
346 |
+
},
|
347 |
+
}
|
348 |
+
```
|
349 |
+
|
350 |
+
**Vision-Language Model**
|
351 |
+
```text
|
352 |
+
@misc{bllossom-V,
|
353 |
+
author = {Dongjae Shin, Hyunseok Lim, Inho Won, Changsu Choi, Minjun Kim, Seungwoo Song, Hangyeol Yoo, Sangmin Kim, Kyungtae Lim},
|
354 |
+
title = {X-LLaVA: Optimizing Bilingual Large Vision-Language Alignment},
|
355 |
+
year = {2024},
|
356 |
+
publisher = {GitHub},
|
357 |
+
journal = {NAACL 2024 findings},
|
358 |
+
paperLink = {\url{https://arxiv.org/pdf/2403.11399}},
|
359 |
+
},
|
360 |
+
}
|
361 |
+
```
|
362 |
+
|
363 |
+
## Contact
|
364 |
+
- μκ²½ν(KyungTae Lim), Professor at Seoultech. `ktlim@seoultech.ac.kr`
|
365 |
+
- ν¨μκ· (Younggyun Hahm), CEO of Teddysum. `hahmyg@teddysum.ai`
|
366 |
+
- κΉνμ(Hansaem Kim), Professor at Yonsei. `khss@yonsei.ac.kr`
|
367 |
+
|
368 |
+
## Contributor
|
369 |
+
- μ΅μ°½μ(Chansu Choi), choics2623@seoultech.ac.kr
|
370 |
+
- κΉμλ―Ό(Sangmin Kim), sangmin9708@naver.com
|
371 |
+
- μμΈνΈ(Inho Won), wih1226@seoultech.ac.kr
|
372 |
+
- κΉλ―Όμ€(Minjun Kim), mjkmain@seoultech.ac.kr
|
373 |
+
- μ‘μΉμ°(Seungwoo Song), sswoo@seoultech.ac.kr
|
374 |
+
- μ λμ¬(Dongjae Shin), dylan1998@seoultech.ac.kr
|
375 |
+
- μνμ(Hyeonseok Lim), gustjrantk@seoultech.ac.kr
|
376 |
+
- μ‘μ ν(Jeonghun Yuk), usually670@gmail.com
|
377 |
+
- μ νκ²°(Hangyeol Yoo), 21102372@seoultech.ac.kr
|
378 |
+
- μ‘μν(Seohyun Song), alexalex225225@gmail.com
|
379 |
+
|