Update README.md
Browse files
README.md
CHANGED
|
@@ -337,12 +337,11 @@ We recommend using the latest version of the Transformers library (at least 4.47
|
|
| 337 |
|
| 338 |
```python
|
| 339 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 340 |
-
|
| 341 |
# 1. Load pre-trained model and tokenizer
|
| 342 |
-
model_name = "baichuan-inc/Baichuan-M1-14B-
|
| 343 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 344 |
-
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 345 |
-
|
| 346 |
# 2. Input prompt text
|
| 347 |
prompt = "May I ask you some questions about medical knowledge?"
|
| 348 |
|
|
|
|
| 337 |
|
| 338 |
```python
|
| 339 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 340 |
+
import torch
|
| 341 |
# 1. Load pre-trained model and tokenizer
|
| 342 |
+
model_name = "baichuan-inc/Baichuan-M1-14B-Base"
|
| 343 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name,trust_remote_code=True)
|
| 344 |
+
model = AutoModelForCausalLM.from_pretrained(model_name,trust_remote_code=True,torch_dtype = torch.bfloat16).cuda()
|
|
|
|
| 345 |
# 2. Input prompt text
|
| 346 |
prompt = "May I ask you some questions about medical knowledge?"
|
| 347 |
|