@@ -266,7 +266,7 @@ def loadOriginalParamsJson(model: LazyModel, config_path: Path) -> Params:
266
266
f_rope_freq_base = config ["rope_theta" ] if "rope_theta" in config else None
267
267
268
268
# hack to determine LLaMA v1 vs v2 vs CodeLlama
269
- if f_rope_freq_base and f_rope_freq_base == 1000000 :
269
+ if f_rope_freq_base == 1000000 :
270
270
# CodeLlama
271
271
n_ctx = 16384
272
272
elif config ["norm_eps" ] == 1e-05 :
@@ -841,9 +841,9 @@ def add_meta_arch(self, params: Params) -> None:
841
841
name = "LLaMA"
842
842
843
843
# TODO: better logic to determine model name
844
- if ( params .n_ctx == 4096 ) :
844
+ if params .n_ctx == 4096 :
845
845
name = "LLaMA v2"
846
- elif params .path_model :
846
+ elif params .path_model is not None :
847
847
name = str (params .path_model .parent ).split ('/' )[- 1 ]
848
848
849
849
self .gguf .add_name (name )
@@ -856,13 +856,13 @@ def add_meta_arch(self, params: Params) -> None:
856
856
self .gguf .add_head_count_kv (params .n_head_kv )
857
857
self .gguf .add_layer_norm_rms_eps (params .f_norm_eps )
858
858
859
- if params .f_rope_freq_base :
859
+ if params .f_rope_freq_base is not None :
860
860
self .gguf .add_rope_freq_base (params .f_rope_freq_base )
861
861
862
- if params .f_rope_scale :
862
+ if params .f_rope_scale is not None :
863
863
self .gguf .add_rope_scale_linear (params .f_rope_scale )
864
864
865
- if params .ftype :
865
+ if params .ftype is not None :
866
866
self .gguf .add_file_type (params .ftype )
867
867
868
868
def add_meta_vocab (self , vocab : Vocab ) -> None :
0 commit comments