mirror of
https://github.com/nomic-ai/gpt4all
synced 2024-11-02 09:40:42 +00:00
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:
parent
596120b44a
commit
4f2b7f7be4
@ -59,8 +59,8 @@ llmodel_model llmodel_model_create(const char *model_path) {
|
|||||||
fread(&magic, sizeof(magic), 1, f);
|
fread(&magic, sizeof(magic), 1, f);
|
||||||
|
|
||||||
if (magic == 0x67676d6c) { model = llmodel_gptj_create(); }
|
if (magic == 0x67676d6c) { model = llmodel_gptj_create(); }
|
||||||
if (magic == 0x67676a74) { model = llmodel_llama_create(); }
|
else if (magic == 0x67676a74) { model = llmodel_llama_create(); }
|
||||||
if (magic == 0x67676d6d) { model = llmodel_mpt_create(); }
|
else if (magic == 0x67676d6d) { model = llmodel_mpt_create(); }
|
||||||
else {fprintf(stderr, "Invalid model file\n");}
|
else {fprintf(stderr, "Invalid model file\n");}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return model;
|
return model;
|
||||||
|
Loading…
Reference in New Issue
Block a user