Update README.md
Browse files
README.md
CHANGED
@@ -39,9 +39,9 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
39 |
ckpt_path = "Mar2Ding/songcomposer_pretrain"
|
40 |
tokenizer = AutoTokenizer.from_pretrained(ckpt_path, trust_remote_code=True)
|
41 |
model = AutoModel.from_pretrained(ckpt_path, trust_remote_code=True).cuda().half()
|
42 |
-
from modeling_internlm2 import
|
43 |
-
prompt = '
|
44 |
-
|
45 |
```
|
46 |
|
47 |
### 通过 Transformers 加载
|
@@ -52,9 +52,9 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
52 |
ckpt_path = "Mar2Ding/songcomposer_pretrain"
|
53 |
tokenizer = AutoTokenizer.from_pretrained(ckpt_path, trust_remote_code=True)
|
54 |
model = AutoModel.from_pretrained(ckpt_path, trust_remote_code=True).cuda().half()
|
55 |
-
from modeling_internlm2 import
|
56 |
-
prompt = '
|
57 |
-
|
58 |
```
|
59 |
|
60 |
### Open Source License
|
|
|
39 |
ckpt_path = "Mar2Ding/songcomposer_pretrain"
|
40 |
tokenizer = AutoTokenizer.from_pretrained(ckpt_path, trust_remote_code=True)
|
41 |
model = AutoModel.from_pretrained(ckpt_path, trust_remote_code=True).cuda().half()
|
42 |
+
from modeling_internlm2 import inference_pretrain
|
43 |
+
prompt = '<bop> Total 7 lines. The first line:可,<D4>,<137>,<79>|惜,<D#4>,<137>,<79>|这,<F4>,<137>,<88>|是,<F4>,<121>,<79>|属,<F4>,<121>,<79>|于,<D#4>,<214>,<88>|你,<D#4>,<141>,<79>|的,<D4>,<130>,<79>|风,<C4>,<151>,<79>|景,<A#3> <F3>,<181><137>,<79>\n'
|
44 |
+
inference_pretrain(prompt, tokenizer, model)
|
45 |
```
|
46 |
|
47 |
### 通过 Transformers 加载
|
|
|
52 |
ckpt_path = "Mar2Ding/songcomposer_pretrain"
|
53 |
tokenizer = AutoTokenizer.from_pretrained(ckpt_path, trust_remote_code=True)
|
54 |
model = AutoModel.from_pretrained(ckpt_path, trust_remote_code=True).cuda().half()
|
55 |
+
from modeling_internlm2 import inference_pretrain
|
56 |
+
prompt = '<bop> Total 7 lines. The first line:可,<D4>,<137>,<79>|惜,<D#4>,<137>,<79>|这,<F4>,<137>,<88>|是,<F4>,<121>,<79>|属,<F4>,<121>,<79>|于,<D#4>,<214>,<88>|你,<D#4>,<141>,<79>|的,<D4>,<130>,<79>|风,<C4>,<151>,<79>|景,<A#3> <F3>,<181><137>,<79>\n'
|
57 |
+
inference_pretrain(prompt, tokenizer, model)
|
58 |
```
|
59 |
|
60 |
### Open Source License
|