Bugfix on llmodel_model_create function

Fixes the bug where llmodel_model_create prints "Invalid model file" even though the model is loaded correctly. Credits and thanks to @serendipity for the fix.
This commit is contained in:
kuvaus 2023-05-17 13:57:56 +03:00 committed by AT
parent 596120b44a
commit 4f2b7f7be4

View File

@ -59,8 +59,8 @@ llmodel_model llmodel_model_create(const char *model_path) {
fread(&magic, sizeof(magic), 1, f);
if (magic == 0x67676d6c) { model = llmodel_gptj_create(); }
if (magic == 0x67676a74) { model = llmodel_llama_create(); }
if (magic == 0x67676d6d) { model = llmodel_mpt_create(); }
else if (magic == 0x67676a74) { model = llmodel_llama_create(); }
else if (magic == 0x67676d6d) { model = llmodel_mpt_create(); }
else {fprintf(stderr, "Invalid model file\n");}
fclose(f);
return model;