readme
Browse files
README.md
CHANGED
|
@@ -82,7 +82,12 @@ model_name = "baidu/ERNIE-4.5-21B-A3B-Base-PT"
|
|
| 82 |
|
| 83 |
# load the tokenizer and the model
|
| 84 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 85 |
-
model = AutoModelForCausalLM.from_pretrained(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
prompt = "Large language model is"
|
| 88 |
model_inputs = tokenizer([prompt], add_special_tokens=False, return_tensors="pt").to(model.device)
|
|
|
|
| 82 |
|
| 83 |
# load the tokenizer and the model
|
| 84 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 85 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 86 |
+
model_name,
|
| 87 |
+
device_map="auto",
|
| 88 |
+
torch_dtype=torch.bfloat16,
|
| 89 |
+
tp_plan="auto",
|
| 90 |
+
)
|
| 91 |
|
| 92 |
prompt = "Large language model is"
|
| 93 |
model_inputs = tokenizer([prompt], add_special_tokens=False, return_tensors="pt").to(model.device)
|