fix: remove config args but pass config when initi auto model

#6
Files changed (1) hide show
  1. 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, **config_args, 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
 
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