Update README.md
Browse files
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 =
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
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))
|