UnicomAI commited on
Commit
dccdec0
1 Parent(s): 6fe1521

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +9 -8
README.md CHANGED
@@ -48,6 +48,7 @@ pipeline_tag: text-generation
48
  ## 快速开始
49
 
50
  ```python
 
51
  from transformers import AutoTokenizer, AutoModelForCausalLM
52
  import torch
53
 
@@ -79,14 +80,14 @@ terminators = [
79
  ]
80
 
81
 
82
- outputs = model.generate(
83
- prompt,
84
- max_new_tokens=2048,
85
- eos_token_id=terminators,
86
- do_sample=False,
87
- temperature=0.6,
88
- top_p=1,
89
- repetition_penalty=1.05
90
  )
91
  response = outputs[0][input_ids.shape[-1]:]
92
  print(tokenizer.decode(response, skip_special_tokens=True))
 
48
  ## 快速开始
49
 
50
  ```python
51
+ import transformers
52
  from transformers import AutoTokenizer, AutoModelForCausalLM
53
  import torch
54
 
 
80
  ]
81
 
82
 
83
+ outputs = pipeline(
84
+ prompt,
85
+ max_new_tokens=2048,
86
+ eos_token_id=terminators,
87
+ do_sample=False,
88
+ temperature=0.6,
89
+ top_p=1,
90
+ repetition_penalty=1.05
91
  )
92
  response = outputs[0][input_ids.shape[-1]:]
93
  print(tokenizer.decode(response, skip_special_tokens=True))