OpenMOSS/MOSS

streamlit run moss_web_demo_streamlit.py --server.port 8888

Opened this issue · 0 comments

AttributeError: 'MossTokenizer' object has no attribute 'encoder'
Traceback:
File "C:\Users\BESP\MOSS-main.venv\lib\site-packages\streamlit\runtime\scriptrunner\exec_code.py", line 88, in exec_func_with_error_handling
result = func()
File "C:\Users\BESP\MOSS-main.venv\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 579, in code_to_exec
exec(code, module.dict)
File "C:\Users\BESP\MOSS-main\moss_web_demo_streamlit.py", line 82, in
tokenizer, model = load_model()
File "C:\Users\BESP\MOSS-main.venv\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 210, in call
return self._get_or_create_cached_value(args, kwargs)
File "C:\Users\BESP\MOSS-main.venv\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 235, in _get_or_create_cached_value
return self._handle_cache_miss(cache, value_key, func_args, func_kwargs)
File "C:\Users\BESP\MOSS-main.venv\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 292, in _handle_cache_miss
computed_value = self._info.func(*func_args, **func_kwargs)
File "C:\Users\BESP\MOSS-main\moss_web_demo_streamlit.py", line 49, in load_model
tokenizer = MossTokenizer.from_pretrained(args.model_name)
File "C:\Users\BESP\MOSS-main.venv\lib\site-packages\transformers\tokenization_utils_base.py", line 2208, in from_pretrained
return cls._from_pretrained(
File "C:\Users\BESP\MOSS-main.venv\lib\site-packages\transformers\tokenization_utils_base.py", line 2442, in _from_pretrained
tokenizer = cls(*init_inputs, **init_kwargs)
File "C:\Users\BESP\MOSS-main\models\tokenization_moss.py", line 161, in init
super().init(
File "C:\Users\BESP\MOSS-main.venv\lib\site-packages\transformers\tokenization_utils.py", line 436, in init
self._add_tokens(
File "C:\Users\BESP\MOSS-main.venv\lib\site-packages\transformers\tokenization_utils.py", line 544, in _add_tokens
current_vocab = self.get_vocab().copy()
File "C:\Users\BESP\MOSS-main\models\tokenization_moss.py", line 194, in get_vocab
return dict(self.encoder, **self.added_tokens_encoder)如何解决