unsubscribe commited on
Commit
9677d68
1 Parent(s): 24815bc

support transformers 4.34.0

Browse files
Files changed (1) hide show
  1. tokenization_internlm.py +7 -7
tokenization_internlm.py CHANGED
@@ -65,6 +65,13 @@ class InternLMTokenizer(PreTrainedTokenizer):
65
  **kwargs,
66
  ):
67
  self.sp_model_kwargs = {} if sp_model_kwargs is None else sp_model_kwargs
 
 
 
 
 
 
 
68
  super().__init__(
69
  bos_token=bos_token,
70
  eos_token=eos_token,
@@ -73,13 +80,6 @@ class InternLMTokenizer(PreTrainedTokenizer):
73
  clean_up_tokenization_spaces=clean_up_tokenization_spaces,
74
  **kwargs,
75
  )
76
- self.vocab_file = vocab_file
77
- self.add_bos_token = add_bos_token
78
- self.add_eos_token = add_eos_token
79
- self.decode_with_prefix_space = decode_with_prefix_space
80
- self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
81
- self.sp_model.Load(vocab_file)
82
- self._no_prefix_space_tokens = None
83
 
84
  """ Initialisation"""
85
 
 
65
  **kwargs,
66
  ):
67
  self.sp_model_kwargs = {} if sp_model_kwargs is None else sp_model_kwargs
68
+ self.vocab_file = vocab_file
69
+ self.add_bos_token = add_bos_token
70
+ self.add_eos_token = add_eos_token
71
+ self.decode_with_prefix_space = decode_with_prefix_space
72
+ self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
73
+ self.sp_model.Load(vocab_file)
74
+ self._no_prefix_space_tokens = None
75
  super().__init__(
76
  bos_token=bos_token,
77
  eos_token=eos_token,
 
80
  clean_up_tokenization_spaces=clean_up_tokenization_spaces,
81
  **kwargs,
82
  )
 
 
 
 
 
 
 
83
 
84
  """ Initialisation"""
85