Merge remote-tracking branch 'origin/master' into concedo

# Conflicts:
#	.github/workflows/docker.yml
#	CMakeLists.txt
#	flake.nix
#	main.cpp
This commit is contained in:
Concedo
2023-03-21 20:48:56 +08:00
7 changed files with 26 additions and 11 deletions
+5 -5
View File
@@ -107,14 +107,14 @@ int llama_model_load(const std::string & fname, llama_model & model, gpt_vocab &
{
uint32_t magic;
fin.read((char *) &magic, sizeof(magic));
if (magic == 0x67676d6c) {
if (magic == FILE_MAGIC_UNVERSIONED) {
fprintf(stderr, "%s: invalid model file '%s' (too old, regenerate your model files!)\n",
__func__, fname.c_str());
legacy_file_format = true;
}
else
{
if (magic != 0x67676d66) {
if (magic != FILE_MAGIC) {
fprintf(stderr, "%s: invalid model file '%s' (bad magic)\n", __func__, fname.c_str());
return false;
}
@@ -122,9 +122,9 @@ int llama_model_load(const std::string & fname, llama_model & model, gpt_vocab &
uint32_t format_version;
fin.read((char *) &format_version, sizeof(format_version));
if (format_version != 1) {
fprintf(stderr, "%s: invalid model file '%s' (unsupported format version %" PRIu32 ")\n",
__func__, fname.c_str(), format_version);
if (format_version != FILE_VERSION) {
fprintf(stderr, "%s: invalid model file '%s' (unsupported format version %" PRIu32 ", expected %d)\n",
__func__, fname.c_str(), format_version, FILE_VERSION);
return false;
}
}