Update README.md
Browse files
README.md
CHANGED
@@ -26,8 +26,8 @@ Tutorial can refer to [baichuan-inc/Baichuan2-13B-Base](https://github.com/baich
|
|
26 |
```python
|
27 |
import torch
|
28 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
29 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
30 |
-
model = AutoModelForCausalLM.from_pretrained("
|
31 |
inputs = tokenizer('登鹳雀楼->王之涣\n夜雨寄北->', return_tensors='pt')
|
32 |
inputs = inputs.to('cuda:0')
|
33 |
pred = model.generate(**inputs, max_new_tokens=64, repetition_penalty=1.1)
|
|
|
26 |
```python
|
27 |
import torch
|
28 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
29 |
+
tokenizer = AutoTokenizer.from_pretrained("kwaikeg/kagentlms_baichuan2_13b_mat", use_fast=False, trust_remote_code=True)
|
30 |
+
model = AutoModelForCausalLM.from_pretrained("kwaikeg/kagentlms_baichuan2_13b_mat", device_map="auto", trust_remote_code=True)
|
31 |
inputs = tokenizer('登鹳雀楼->王之涣\n夜雨寄北->', return_tensors='pt')
|
32 |
inputs = inputs.to('cuda:0')
|
33 |
pred = model.generate(**inputs, max_new_tokens=64, repetition_penalty=1.1)
|