AntonV HF Staff commited on
Commit
c06942e
·
1 Parent(s): 4423e12
Files changed (1) hide show
  1. README.md +7 -2
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, trust_remote_code)
81
- model = AutoModelForCausalLM.from_pretrained(model_name)
 
 
 
 
 
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."