MrBananaHuman
commited on
Commit
·
f9f9853
1
Parent(s):
61855bb
Update README.md
Browse files
README.md
CHANGED
@@ -4,8 +4,23 @@ kakao brain에서 공개한 kogpt 6b model('kakaobrain/kogpt')을 fp16으로 저
|
|
4 |
|
5 |
```
|
6 |
from transformers import GPTJForCausalLM
|
|
|
7 |
model = GPTJForCausalLM.from_pretrained('kakaobrain/kogpt', cache_dir='./my_dir', revision='KoGPT6B-ryan1.5b', torch_dtype=torch.float16)
|
8 |
```
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
### 참고 링크
|
11 |
https://github.com/kakaobrain/kogpt/issues/6?fbclid=IwAR1KpWhuHnevQvEWV18o16k2z9TLgrXkbWTkKqzL-NDXHfDnWcIq7I4SJXM
|
|
|
4 |
|
5 |
```
|
6 |
from transformers import GPTJForCausalLM
|
7 |
+
|
8 |
model = GPTJForCausalLM.from_pretrained('kakaobrain/kogpt', cache_dir='./my_dir', revision='KoGPT6B-ryan1.5b', torch_dtype=torch.float16)
|
9 |
```
|
10 |
|
11 |
+
### fp16 모델 로드 후 문장 생성
|
12 |
+
|
13 |
+
```
|
14 |
+
from transformers import GPTJForCausalLM, AutoTokenizer
|
15 |
+
|
16 |
+
model = GPTJForCausalLM.from_pretrained('MrBananaHuman/kogpt_6b_fp16')
|
17 |
+
model.to('cuda')
|
18 |
+
tokenizer = AutoTokenizer.from_pretrained('MrBananaHuman/kogpt_6b_fp16')
|
19 |
+
|
20 |
+
input_text = '이순신은'
|
21 |
+
input_ids = tokenizer.encode(input_text,
|
22 |
+
|
23 |
+
```
|
24 |
+
|
25 |
### 참고 링크
|
26 |
https://github.com/kakaobrain/kogpt/issues/6?fbclid=IwAR1KpWhuHnevQvEWV18o16k2z9TLgrXkbWTkKqzL-NDXHfDnWcIq7I4SJXM
|