Fix loading Phi-3 (#48)

This commit is contained in:
Maarten Grootendorst
2025-04-04 08:34:35 +02:00
committed by GitHub
parent e55a0738aa
commit aabef6b341
6 changed files with 9 additions and 9 deletions

View File

@@ -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\")"
]

View File

@@ -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\")"
]

View File

@@ -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",

View File

@@ -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",

View File

@@ -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\""
]