geekjuruo / LEAD

A Chinese Spell Checking Model Released on EMNLP2022.
19 stars 1 forks source link

run error #3

Closed LucasSpider closed 1 year ago

LucasSpider commented 1 year ago

Run times error: Traceback (most recent call last): File "/home/nlp/MyProject/LEAD/main.py", line 49, in pipeline.initialize() File "/home/nlp/MyProject/LEAD/pipeline/BasicPipeline.py", line 104, in initialize self.init_model() File "/home/nlp/MyProject/LEAD/pipeline/MultiModelPipeline.py", line 17, in init_model super(MultiModelPipeline, self).init_model() File "/home/nlp/MyProject/LEAD/pipeline/BasicPipeline.py", line 84, in init_model model = model_class() File "/home/nlp/MyProject/LEAD/model/GlyphClassifier.py", line 13, in init self.bert = GlyphEncoder() File "/home/nlp/MyProject/LEAD/model/GlyphEncoder.py", line 16, in init bert_config = BertConfig.from_pretrained(os.path.join(glyph_path, "config.json")) File "/home/nlp/anaconda3/envs/lead/lib/python3.9/site-packages/transformers/configuration_utils.py", line 501, in from_pretrained config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs) File "/home/nlp/anaconda3/envs/lead/lib/python3.9/site-packages/transformers/configuration_utils.py", line 550, in get_config_dict configuration_file = get_configuration_file( File "/home/nlp/anaconda3/envs/lead/lib/python3.9/site-packages/transformers/configuration_utils.py", line 841, in get_configuration_file all_files = get_list_of_files( File "/home/nlp/anaconda3/envs/lead/lib/python3.9/site-packages/transformers/file_utils.py", line 1952, in get_list_of_files return list_repo_files(path_or_repo, revision=revision, token=token) File "/home/nlp/anaconda3/envs/lead/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 112, in _inner_fn validate_repo_id(arg_value) File "/home/nlp/anaconda3/envs/lead/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 160, in validate_repo_id raise HFValidationError( huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': './resources/glyph/config.json'. Use repo_type argument if needed. , it seems that the reason for the error because no. / resources/glyph/config. The json 'file, please glyph - enhanced pretrained model specific which one is to download, is GCC using the training model in the link or GCC model after fine-tuning, And where do you get the required configuration files? Or can you provide it?

masr2000 commented 1 year ago

Please refer to the GCC repository: https://github.com/lbe0613/GCC, and ensure that the directory structure is consistent with the code and configuration files.