fix: remove config args but pass config when initi auto model (#6)
Browse files- fix: remove config args but pass config when initi auto model (2da9381b5f52128f5e6284731aff667651282423)
- custom_st.py +1 -1
 
    	
        custom_st.py
    CHANGED
    
    | 
         @@ -54,7 +54,7 @@ class Transformer(nn.Module): 
     | 
|
| 54 | 
         
             
                        config_args = {}
         
     | 
| 55 | 
         | 
| 56 | 
         
             
                    config = AutoConfig.from_pretrained(model_name_or_path, **config_args, cache_dir=cache_dir)
         
     | 
| 57 | 
         
            -
                    self.auto_model = AutoModel.from_pretrained(model_name_or_path,  
     | 
| 58 | 
         | 
| 59 | 
         
             
                    if max_seq_length is not None and "model_max_length" not in tokenizer_args:
         
     | 
| 60 | 
         
             
                        tokenizer_args["model_max_length"] = max_seq_length
         
     | 
| 
         | 
|
| 54 | 
         
             
                        config_args = {}
         
     | 
| 55 | 
         | 
| 56 | 
         
             
                    config = AutoConfig.from_pretrained(model_name_or_path, **config_args, cache_dir=cache_dir)
         
     | 
| 57 | 
         
            +
                    self.auto_model = AutoModel.from_pretrained(model_name_or_path, config=config, cache_dir=cache_dir, **model_args)
         
     | 
| 58 | 
         | 
| 59 | 
         
             
                    if max_seq_length is not None and "model_max_length" not in tokenizer_args:
         
     | 
| 60 | 
         
             
                        tokenizer_args["model_max_length"] = max_seq_length
         
     |