@@ -64,12 +64,12 @@ bool llama_model_quantize(const std::string & fname_inp, const std::string & fna
6464    {
6565        uint32_t  magic;
6666        finp.read ((char  *) &magic, sizeof (magic));
67-         if  (magic == 0x67676d6c ) {
67+         if  (magic == FILE_MAGIC_UNVERSIONED ) {
6868            fprintf (stderr, " %s: invalid model file '%s' (too old, regenerate your model files!)\n " 
6969                    __func__, fname_inp.c_str ());
7070            return  false ;
7171        }
72-         if  (magic != 0x67676d66 ) {
72+         if  (magic != FILE_MAGIC ) {
7373            fprintf (stderr, " %s: invalid model file '%s' (bad magic)\n " c_str ());
7474            return  false ;
7575        }
@@ -79,9 +79,9 @@ bool llama_model_quantize(const std::string & fname_inp, const std::string & fna
7979        uint32_t  format_version;
8080        finp.read ((char  *) &format_version, sizeof (format_version));
8181
82-         if  (format_version != 1 ) {
83-             fprintf (stderr, " %s: invalid model file '%s' (unsupported format version %" " )\n " 
84-                     __func__, fname_inp.c_str (), format_version);
82+         if  (format_version != FILE_VERSION ) {
83+             fprintf (stderr, " %s: invalid model file '%s' (unsupported format version %" " , expected %d )\n " 
84+                     __func__, fname_inp.c_str (), format_version, FILE_VERSION );
8585            return  false ;
8686        }
8787
0 commit comments