allow mmproj to be run on cpu

This commit is contained in:
Concedo 2025-04-21 21:03:10 +08:00
parent f968079290
commit 9cd6a1add2
3 changed files with 14 additions and 1 deletions

View file

@ -2320,6 +2320,11 @@ ModelLoadResult gpttype_load_model(const load_model_inputs inputs, FileFormat in
printf("Clip will use CPU for this model!\n");
}
#endif
if(inputs.mmproj_cpu)
{
set_clip_uses_gpu(false);
printf("Clip forced to use CPU!\n");
}
clp_ctx = clip_model_load(mmproj_filename.c_str(), /*verbosity=*/ 1);
if(clp_ctx == nullptr) {
fprintf(stderr, "%s: error: failed to load mmproj model!\n", __func__);