readme
Browse files
README.md
CHANGED
|
@@ -77,8 +77,13 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
| 77 |
model_name = "baidu/ERNIE-4.5-21B-A3B-PT"
|
| 78 |
|
| 79 |
# load the tokenizer and the model
|
| 80 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name
|
| 81 |
-
model = AutoModelForCausalLM.from_pretrained(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
# prepare the model input
|
| 84 |
prompt = "Give me a short introduction to large language model."
|
|
|
|
| 77 |
model_name = "baidu/ERNIE-4.5-21B-A3B-PT"
|
| 78 |
|
| 79 |
# load the tokenizer and the model
|
| 80 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 81 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 82 |
+
model_name,
|
| 83 |
+
device_map="auto",
|
| 84 |
+
torch_dtype=torch.bfloat16,
|
| 85 |
+
tp_plan="auto",
|
| 86 |
+
)
|
| 87 |
|
| 88 |
# prepare the model input
|
| 89 |
prompt = "Give me a short introduction to large language model."
|