Update README.md
Browse files
README.md
CHANGED
@@ -2,12 +2,18 @@
|
|
2 |
language:
|
3 |
- en
|
4 |
- ko
|
5 |
-
license:
|
6 |
library_name: transformers
|
|
|
|
|
|
|
7 |
base_model:
|
8 |
- meta-llama/Meta-Llama-3-8B
|
|
|
|
|
9 |
---
|
10 |
|
|
|
11 |
<a href="https://github.com/MLP-Lab/Bllossom">
|
12 |
<img src="https://github.com/teddysum/bllossom/blob/main//bllossom_icon.png?raw=true" width="40%" height="50%">
|
13 |
</a>
|
@@ -43,6 +49,9 @@ The Bllossom language model is a Korean-English bilingual language model based o
|
|
43 |
* **Vision-Language Alignment**: Aligning the vision transformer with this language model
|
44 |
|
45 |
**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)**
|
|
|
|
|
|
|
46 |
|
47 |
## Demo Video
|
48 |
|
@@ -76,119 +85,37 @@ The Bllossom language model is a Korean-English bilingual language model based o
|
|
76 |
|
77 |
## Example code
|
78 |
|
79 |
-
### Colab Tutorial
|
80 |
-
- [Inference-Code-Link](https://colab.research.google.com/drive/1fBOzUVZ6NRKk_ugeoTbAOokWKqSN47IG?usp=sharing)
|
81 |
|
82 |
-
|
|
|
|
|
|
|
83 |
```bash
|
84 |
-
|
85 |
```
|
|
|
86 |
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
model_id = "MLP-KTLim/llama-3-Korean-Bllossom-8B"
|
93 |
-
|
94 |
-
pipeline = transformers.pipeline(
|
95 |
-
"text-generation",
|
96 |
-
model=model_id,
|
97 |
-
model_kwargs={"torch_dtype": torch.bfloat16},
|
98 |
-
device_map="auto",
|
99 |
-
)
|
100 |
-
|
101 |
-
pipeline.model.eval()
|
102 |
-
|
103 |
-
PROMPT = '''๋น์ ์ ์ ์ฉํ AI ์ด์์คํดํธ์
๋๋ค. ์ฌ์ฉ์์ ์ง์์ ๋ํด ์น์ ํ๊ณ ์ ํํ๊ฒ ๋ต๋ณํด์ผ ํฉ๋๋ค.
|
104 |
-
You are a helpful AI assistant, you'll need to answer users' queries in a friendly and accurate manner.'''
|
105 |
-
instruction = "์์ธ๊ณผํ๊ธฐ์ ๋ํ๊ต MLP์ฐ๊ตฌ์ค์ ๋ํด ์๊ฐํด์ค"
|
106 |
-
|
107 |
-
messages = [
|
108 |
-
{"role": "system", "content": f"{PROMPT}"},
|
109 |
-
{"role": "user", "content": f"{instruction}"}
|
110 |
-
]
|
111 |
-
|
112 |
-
prompt = pipeline.tokenizer.apply_chat_template(
|
113 |
-
messages,
|
114 |
-
tokenize=False,
|
115 |
-
add_generation_prompt=True
|
116 |
-
)
|
117 |
-
|
118 |
-
terminators = [
|
119 |
-
pipeline.tokenizer.eos_token_id,
|
120 |
-
pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
|
121 |
-
]
|
122 |
-
|
123 |
-
outputs = pipeline(
|
124 |
-
prompt,
|
125 |
-
max_new_tokens=2048,
|
126 |
-
eos_token_id=terminators,
|
127 |
-
do_sample=True,
|
128 |
-
temperature=0.6,
|
129 |
-
top_p=0.9,
|
130 |
-
repetition_penalty = 1.1
|
131 |
-
)
|
132 |
-
|
133 |
-
print(outputs[0]["generated_text"][len(prompt):])
|
134 |
-
|
135 |
-
# ์์ธ๊ณผํ๊ธฐ์ ๋ํ๊ต MLP์ฐ๊ตฌ์ค์ ๋ฉํฐ๋ชจ๋ฌ ์์ฐ์ด์ฒ๋ฆฌ ์ฐ๊ตฌ๋ฅผ ํ๊ณ ์์ต๋๋ค. ๊ตฌ์ฑ์์ ์๊ฒฝํ ๊ต์์ ๊น๋ฏผ์ค, ๊น์๋ฏผ, ์ต์ฐฝ์, ์์ธํธ, ์ ํ๊ฒฐ, ์ํ์, ์ก์น์ฐ, ์ก์ ํ, ์ ๋์ฌ ํ์์ด ์์ต๋๋ค.
|
136 |
```
|
137 |
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
model = AutoModelForCausalLM.from_pretrained(
|
149 |
-
model_id,
|
150 |
-
torch_dtype=torch.bfloat16,
|
151 |
-
device_map="auto",
|
152 |
-
)
|
153 |
-
|
154 |
-
model.eval()
|
155 |
-
|
156 |
-
PROMPT = '''๋น์ ์ ์ ์ฉํ AI ์ด์์คํดํธ์
๋๋ค. ์ฌ์ฉ์์ ์ง์์ ๋ํด ์น์ ํ๊ณ ์ ํํ๊ฒ ๋ต๋ณํด์ผ ํฉ๋๋ค.
|
157 |
-
You are a helpful AI assistant, you'll need to answer users' queries in a friendly and accurate manner.'''
|
158 |
-
instruction = "์์ธ๊ณผํ๊ธฐ์ ๋ํ๊ต MLP์ฐ๊ตฌ์ค์ ๋ํด ์๊ฐํด์ค"
|
159 |
-
|
160 |
-
messages = [
|
161 |
-
{"role": "system", "content": f"{PROMPT}"},
|
162 |
-
{"role": "user", "content": f"{instruction}"}
|
163 |
-
]
|
164 |
-
|
165 |
-
input_ids = tokenizer.apply_chat_template(
|
166 |
-
messages,
|
167 |
-
add_generation_prompt=True,
|
168 |
-
return_tensors="pt"
|
169 |
-
).to(model.device)
|
170 |
-
|
171 |
-
terminators = [
|
172 |
-
tokenizer.eos_token_id,
|
173 |
-
tokenizer.convert_tokens_to_ids("<|eot_id|>")
|
174 |
-
]
|
175 |
-
|
176 |
-
outputs = model.generate(
|
177 |
-
input_ids,
|
178 |
-
max_new_tokens=2048,
|
179 |
-
eos_token_id=terminators,
|
180 |
-
do_sample=True,
|
181 |
-
temperature=0.6,
|
182 |
-
top_p=0.9,
|
183 |
-
repetition_penalty = 1.1
|
184 |
-
)
|
185 |
-
|
186 |
-
print(tokenizer.decode(outputs[0][input_ids.shape[-1]:], skip_special_tokens=True))
|
187 |
-
# ์์ธ๊ณผํ๊ธฐ์ ๋ํ๊ต MLP์ฐ๊ตฌ์ค์ ๋ฉํฐ๋ชจ๋ฌ ์์ฐ์ด์ฒ๋ฆฌ ์ฐ๊ตฌ๋ฅผ ํ๊ณ ์์ต๋๋ค. ๊ตฌ์ฑ์์ ์๊ฒฝํ ๊ต์์ ๊น๋ฏผ์ค, ๊น์๋ฏผ, ์ต์ฐฝ์, ์์ธํธ, ์ ํ๊ฒฐ, ์ํ์, ์ก์น์ฐ, ์ก์ ํ, ์ ๋์ฌ ํ์์ด ์์ต๋๋ค.
|
188 |
```
|
189 |
|
190 |
|
191 |
|
|
|
192 |
## Citation
|
193 |
**Language Model**
|
194 |
```text
|
|
|
2 |
language:
|
3 |
- en
|
4 |
- ko
|
5 |
+
license: apache-2.0
|
6 |
library_name: transformers
|
7 |
+
tags:
|
8 |
+
- llama-cpp
|
9 |
+
- gguf-my-repo
|
10 |
base_model:
|
11 |
- meta-llama/Meta-Llama-3-8B
|
12 |
+
- jeiku/Average_Test_v1
|
13 |
+
- ResplendentAI/RP_Format_QuoteAsterisk_Llama3
|
14 |
---
|
15 |
|
16 |
+
|
17 |
<a href="https://github.com/MLP-Lab/Bllossom">
|
18 |
<img src="https://github.com/teddysum/bllossom/blob/main//bllossom_icon.png?raw=true" width="40%" height="50%">
|
19 |
</a>
|
|
|
49 |
* **Vision-Language Alignment**: Aligning the vision transformer with this language model
|
50 |
|
51 |
**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)**
|
52 |
+
This model was converted to GGUF format from [`ResplendentAI/SOVL_Llama3_8B`](https://huggingface.co/ResplendentAI/SOVL_Llama3_8B) using llama.cpp via the ggml.ai's [GGUF-my-repo](https://huggingface.co/spaces/ggml-org/gguf-my-repo) space.
|
53 |
+
Refer to the [original model card](https://huggingface.co/ResplendentAI/SOVL_Llama3_8B) for more details on the model.
|
54 |
+
|
55 |
|
56 |
## Demo Video
|
57 |
|
|
|
85 |
|
86 |
## Example code
|
87 |
|
|
|
|
|
88 |
|
89 |
+
## Use with llama.cpp
|
90 |
+
|
91 |
+
Install llama.cpp through brew.
|
92 |
+
|
93 |
```bash
|
94 |
+
brew install ggerganov/ggerganov/llama.cpp
|
95 |
```
|
96 |
+
Invoke the llama.cpp server or the CLI.
|
97 |
|
98 |
+
CLI:
|
99 |
+
|
100 |
+
```bash
|
101 |
+
llama-cli --hf-repo jeiku/SOVL_Llama3_8B-Q4_K_M-GGUF --model sovl_llama3_8b.Q4_K_M.gguf -p "The meaning to life and the universe is"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
```
|
103 |
|
104 |
+
Server:
|
105 |
+
|
106 |
+
```bash
|
107 |
+
llama-server --hf-repo jeiku/SOVL_Llama3_8B-Q4_K_M-GGUF --model sovl_llama3_8b.Q4_K_M.gguf -c 2048
|
108 |
+
```
|
109 |
+
|
110 |
+
Note: You can also use this checkpoint directly through the [usage steps](https://github.com/ggerganov/llama.cpp?tab=readme-ov-file#usage) listed in the Llama.cpp repo as well.
|
111 |
+
|
112 |
+
```
|
113 |
+
git clone https://github.com/ggerganov/llama.cpp && cd llama.cpp && make && ./main -m sovl_llama3_8b.Q4_K_M.gguf -n 128
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
```
|
115 |
|
116 |
|
117 |
|
118 |
+
|
119 |
## Citation
|
120 |
**Language Model**
|
121 |
```text
|