Fix loading Phi-3 (#48)
This commit is contained in:
committed by
GitHub
parent
e55a0738aa
commit
aabef6b341
@@ -69,7 +69,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"id": "RSNalRXZyTTk"
|
||||
},
|
||||
@@ -82,7 +82,7 @@
|
||||
" \"microsoft/Phi-3-mini-4k-instruct\",\n",
|
||||
" device_map=\"cuda\",\n",
|
||||
" torch_dtype=\"auto\",\n",
|
||||
" trust_remote_code=True,\n",
|
||||
" trust_remote_code=False,\n",
|
||||
")\n",
|
||||
"tokenizer = AutoTokenizer.from_pretrained(\"microsoft/Phi-3-mini-4k-instruct\")"
|
||||
]
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"colab": {
|
||||
"base_uri": "https://localhost:8080/",
|
||||
@@ -278,7 +278,7 @@
|
||||
" \"microsoft/Phi-3-mini-4k-instruct\",\n",
|
||||
" device_map=\"cuda\",\n",
|
||||
" torch_dtype=\"auto\",\n",
|
||||
" trust_remote_code=True,\n",
|
||||
" trust_remote_code=False,\n",
|
||||
")\n",
|
||||
"tokenizer = AutoTokenizer.from_pretrained(\"microsoft/Phi-3-mini-4k-instruct\")"
|
||||
]
|
||||
|
||||
@@ -483,7 +483,7 @@
|
||||
" \"microsoft/Phi-3-mini-4k-instruct\",\n",
|
||||
" device_map=\"cuda\",\n",
|
||||
" torch_dtype=\"auto\",\n",
|
||||
" trust_remote_code=True,\n",
|
||||
" trust_remote_code=False,\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"# Create a pipeline\n",
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
" \"microsoft/Phi-3-mini-4k-instruct\",\n",
|
||||
" device_map=\"cuda\",\n",
|
||||
" torch_dtype=\"auto\",\n",
|
||||
" trust_remote_code=True,\n",
|
||||
" trust_remote_code=False,\n",
|
||||
")\n",
|
||||
"tokenizer = AutoTokenizer.from_pretrained(\"microsoft/Phi-3-mini-4k-instruct\")\n",
|
||||
"\n",
|
||||
|
||||
@@ -859,7 +859,7 @@
|
||||
"model.config.pretraining_tp = 1\n",
|
||||
"\n",
|
||||
"# Load LLaMA tokenizer\n",
|
||||
"tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)\n",
|
||||
"tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=False)\n",
|
||||
"tokenizer.pad_token = \"<PAD>\"\n",
|
||||
"tokenizer.padding_side = \"left\""
|
||||
]
|
||||
@@ -1598,7 +1598,7 @@
|
||||
"\n",
|
||||
"# Load LLaMA tokenizer\n",
|
||||
"model_name = \"TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T\"\n",
|
||||
"tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)\n",
|
||||
"tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=False)\n",
|
||||
"tokenizer.pad_token = \"<PAD>\"\n",
|
||||
"tokenizer.padding_side = \"left\""
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user