Update replit_lm_tokenizer.py
#33
by
dobbySeo
- opened
- replit_lm_tokenizer.py +2 -1
replit_lm_tokenizer.py
CHANGED
@@ -63,10 +63,11 @@ class ReplitLMTokenizer(PreTrainedTokenizer):
|
|
63 |
|
64 |
def __init__(self, vocab_file, bos_token=None, eos_token='<|endoftext|>', unk_token='<|unk|>', pad_token='<|pad|>', sep_token=None, sp_model_kwargs: Optional[Dict[str, Any]]=None, **kwargs) -> None:
|
65 |
self.sp_model_kwargs = {} if sp_model_kwargs is None else sp_model_kwargs
|
66 |
-
super().__init__(bos_token=bos_token, eos_token=eos_token, unk_token=unk_token, pad_token=pad_token, sep_token=sep_token, sp_model_kwargs=self.sp_model_kwargs, **kwargs)
|
67 |
self.vocab_file = vocab_file
|
68 |
self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
|
69 |
self.sp_model.Load(vocab_file)
|
|
|
70 |
|
71 |
@property
|
72 |
def vocab_size(self):
|
|
|
63 |
|
64 |
def __init__(self, vocab_file, bos_token=None, eos_token='<|endoftext|>', unk_token='<|unk|>', pad_token='<|pad|>', sep_token=None, sp_model_kwargs: Optional[Dict[str, Any]]=None, **kwargs) -> None:
|
65 |
self.sp_model_kwargs = {} if sp_model_kwargs is None else sp_model_kwargs
|
66 |
+
# super().__init__(bos_token=bos_token, eos_token=eos_token, unk_token=unk_token, pad_token=pad_token, sep_token=sep_token, sp_model_kwargs=self.sp_model_kwargs, **kwargs)
|
67 |
self.vocab_file = vocab_file
|
68 |
self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
|
69 |
self.sp_model.Load(vocab_file)
|
70 |
+
super().__init__(bos_token=bos_token, eos_token=eos_token, unk_token=unk_token, pad_token=pad_token, sep_token=sep_token, sp_model_kwargs=self.sp_model_kwargs, **kwargs)
|
71 |
|
72 |
@property
|
73 |
def vocab_size(self):
|