bwang0911 commited on
Commit
cd40fae
1 Parent(s): 8177662

fix: not properly reference config (#12)

Browse files

- fix: not properly reference config (a65808d3e03b5c65ad9fcc03a778ec3b86165caf)

Files changed (1) hide show
  1. custom_st.py +3 -3
custom_st.py CHANGED
@@ -53,10 +53,10 @@ class Transformer(nn.Module):
53
  if config_args is None:
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
- self._lora_adaptations = config.lora_adaptations
60
  if (
61
  not isinstance(self._lora_adaptations, list)
62
  or len(self._lora_adaptations) < 1
 
53
  if config_args is None:
54
  config_args = {}
55
 
56
+ self.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=self.config, cache_dir=cache_dir, **model_args)
58
 
59
+ self._lora_adaptations = self.config.lora_adaptations
60
  if (
61
  not isinstance(self._lora_adaptations, list)
62
  or len(self._lora_adaptations) < 1