Mar2Ding commited on
Commit
e09ff81
1 Parent(s): 3e80e97

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -6
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 inference
43
- prompt = 'Create a song on brave and sacrificing with a rapid pace.'
44
- inference(prompt, tokenizer, model)
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 inference
56
- prompt = 'Create a song on brave and sacrificing with a rapid pace.'
57
- inference(prompt, tokenizer, model)
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