readme
Browse files
README.md
CHANGED
|
@@ -74,7 +74,11 @@ model_name = "baidu/ERNIE-4.5-0.3B-PT"
|
|
| 74 |
|
| 75 |
# load the tokenizer and the model
|
| 76 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 77 |
-
model = AutoModelForCausalLM.from_pretrained(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
# prepare the model input
|
| 80 |
prompt = "Give me a short introduction to large language model."
|
|
|
|
| 74 |
|
| 75 |
# load the tokenizer and the model
|
| 76 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 77 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 78 |
+
model_name,
|
| 79 |
+
device_map="auto",
|
| 80 |
+
torch_dtype=torch.bfloat16,
|
| 81 |
+
)
|
| 82 |
|
| 83 |
# prepare the model input
|
| 84 |
prompt = "Give me a short introduction to large language model."
|