jujbob commited on
Commit
d7f6c77
โ€ข
1 Parent(s): 31f16eb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +31 -104
README.md CHANGED
@@ -2,12 +2,18 @@
2
  language:
3
  - en
4
  - ko
5
- license: llama3
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
- ### Install Dependencies
 
 
 
83
  ```bash
84
- pip install torch transformers==4.40.0 accelerate
85
  ```
 
86
 
87
- ### Python code with Pipeline
88
- ```python
89
- import transformers
90
- import torch
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
- ### Python code with AutoModel
139
- ```python
140
-
141
- import os
142
- import torch
143
- from transformers import AutoTokenizer, AutoModelForCausalLM
144
-
145
- model_id = 'MLP-KTLim/llama-3-Korean-Bllossom-8B'
146
-
147
- tokenizer = AutoTokenizer.from_pretrained(model_id)
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