Update README.md
Browse files
README.md
CHANGED
@@ -24,6 +24,7 @@ language:
|
|
24 |
|
25 |
```python
|
26 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
27 |
import torch
|
28 |
torch.manual_seed(1234)
|
29 |
model_path = 'ChatTruth-7B' # your downloaded model path.
|
@@ -33,7 +34,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
|
|
33 |
# use cuda device
|
34 |
model = AutoModelForCausalLM.from_pretrained(model_path, device_map="cuda", trust_remote_code=True).eval()
|
35 |
|
36 |
-
model.generation_config = GenerationConfig.from_pretrained(
|
37 |
model.generation_config.top_p = 0.01
|
38 |
|
39 |
query = tokenizer.from_list_format([
|
|
|
24 |
|
25 |
```python
|
26 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
27 |
+
from transformers.generation import GenerationConfig
|
28 |
import torch
|
29 |
torch.manual_seed(1234)
|
30 |
model_path = 'ChatTruth-7B' # your downloaded model path.
|
|
|
34 |
# use cuda device
|
35 |
model = AutoModelForCausalLM.from_pretrained(model_path, device_map="cuda", trust_remote_code=True).eval()
|
36 |
|
37 |
+
model.generation_config = GenerationConfig.from_pretrained(model_path, trust_remote_code=True)
|
38 |
model.generation_config.top_p = 0.01
|
39 |
|
40 |
query = tokenizer.from_list_format([
|