Support accelerate and fix tokenizer `TypeError: argument of type 'NoneType' is not iterable`

#5
by larrylawl - opened
Files changed (2) hide show
  1. modeling_glm.py +1 -0
  2. tokenizer_config.json +1 -2
modeling_glm.py CHANGED
@@ -625,6 +625,7 @@ class GLMPreTrainedModel(PreTrainedModel):
625
  base_model_prefix = "glm"
626
  supports_gradient_checkpointing = True
627
  _keys_to_ignore_on_load_missing = [r"position_ids"]
 
628
 
629
  def _init_weights(self, module):
630
  """ Initialize the weights """
 
625
  base_model_prefix = "glm"
626
  supports_gradient_checkpointing = True
627
  _keys_to_ignore_on_load_missing = [r"position_ids"]
628
+ _no_split_modules = ["GLMBlock"]
629
 
630
  def _init_weights(self, module):
631
  """ Initialize the weights """
tokenizer_config.json CHANGED
@@ -11,8 +11,7 @@
11
  "use_fast": false,
12
  "auto_map": {
13
  "AutoTokenizer": [
14
- "tokenization_glm.GLMChineseTokenizer",
15
- null
16
  ]
17
  }
18
  }
 
11
  "use_fast": false,
12
  "auto_map": {
13
  "AutoTokenizer": [
14
+ "tokenization_glm.GLMChineseTokenizer"
 
15
  ]
16
  }
17
  }