Skip to content

Commit 8d8264f

Browse files
report error if model_dir doesnt exist
1 parent f91a73b commit 8d8264f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

notebooks/glm4.1-v-thinking/glm4.1-v-thinking.ipynb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@
195195
},
196196
{
197197
"cell_type": "code",
198-
"execution_count": 14,
198+
"execution_count": null,
199199
"metadata": {},
200200
"outputs": [],
201201
"source": [
202-
"if not model_dir.exists() and not model_base_dir.exists():\n",
202+
"if not model_base_dir.exists():\n",
203203
" !huggingface-cli download {model_id} --local-dir {model_base_dir} --revision 17193d2147da3acd0da358eb251ef862b47e7545 --quiet"
204204
]
205205
},
@@ -236,8 +236,11 @@
236236
"source": [
237237
"from cmd_helper import optimum_cli\n",
238238
"\n",
239+
"if not model_base_dir.exists():\n",
240+
" raise FileNotFoundError(f\"Model base directory {model_base_dir} does not exist. Please run the cell above to download the model first.\")\n",
241+
"\n",
239242
"if not model_dir.exists():\n",
240-
" optimum_cli(str(model_base_dir), str(model_dir), additional_args=additional_args)"
243+
" optimum_cli(model_base_dir, model_dir, additional_args=additional_args)"
241244
]
242245
},
243246
{

0 commit comments

Comments
 (0)