@@ -2858,9 +2858,6 @@ class LLaDAModel(TextModel):
2858
2858
2859
2859
def __init__ (self , * args , ** kwargs ):
2860
2860
super ().__init__ (* args , ** kwargs )
2861
- # fix for SmolVLM2, missing `num_attention_heads` in config.json
2862
- if self .hf_arch == "VLlama3ForCausalLM" :
2863
- self .hparams ["num_attention_heads" ] = self .hparams .get ("num_attention_heads" , 32 )
2864
2861
2865
2862
def get_vocab_base (self ) -> tuple [list [str ], list [int ], str ]:
2866
2863
tokens : list [str ] = []
@@ -2909,29 +2906,6 @@ def set_vocab(self):
2909
2906
# Llama 3
2910
2907
self ._set_vocab_gpt2 ()
2911
2908
2912
- # Apply to CodeLlama only (and ignore for Llama 3 with a vocab size of 128256)
2913
- if self .hparams .get ("vocab_size" , 32000 ) == 32016 :
2914
- special_vocab = gguf .SpecialVocab (
2915
- self .dir_model , load_merges = False ,
2916
- special_token_types = ['prefix' , 'suffix' , 'middle' , 'eot' ]
2917
- )
2918
- special_vocab ._set_special_token ("prefix" , 32007 )
2919
- special_vocab ._set_special_token ("suffix" , 32008 )
2920
- special_vocab ._set_special_token ("middle" , 32009 )
2921
- special_vocab ._set_special_token ("eot" , 32010 )
2922
- special_vocab .add_to_gguf (self .gguf_writer )
2923
-
2924
- tokenizer_config_file = self .dir_model / 'tokenizer_config.json'
2925
- if tokenizer_config_file .is_file ():
2926
- with open (tokenizer_config_file , "r" , encoding = "utf-8" ) as f :
2927
- tokenizer_config_json = json .load (f )
2928
- if "add_prefix_space" in tokenizer_config_json :
2929
- self .gguf_writer .add_add_space_prefix (tokenizer_config_json ["add_prefix_space" ])
2930
-
2931
- # Apply to granite small models only
2932
- if self .hparams .get ("vocab_size" , 32000 ) == 49152 :
2933
- self .gguf_writer .add_add_bos_token (False )
2934
-
2935
2909
def set_gguf_parameters (self ):
2936
2910
super ().set_gguf_parameters ()
2937
2911
self ._try_set_pooling_type ()
0 commit comments