当前位置:   article > 正文

BERTScore报错:huggingface_hub.utils._validators.HFValidationError

huggingface_hub.utils._validators.hfvalidationerror: repo id must be in the
  1. Traceback (most recent call last):
  2. File "test.py", line 53, in <module>
  3. b_scorer = BERTScorer(lang="zh", model_type=embedding_model_dirpath, num_layers=num_layers)
  4. File "bert_score/scorer.py", line 97, in __init__
  5. self._tokenizer = get_tokenizer(self.model_type, self._use_fast_tokenizer)
  6. File "bert_score/utils.py", line 343, in get_tokenizer
  7. tokenizer = AutoTokenizer.from_pretrained(model_type, use_fast=use_fast)
  8. File "/root/anaconda3/envs/vllm/lib/python3.9/site-packages/transformers/models/auto/tokenization_auto.py", line 701, in from_pretrained
  9. tokenizer_config = get_tokenizer_config(pretrained_model_name_or_path, **kwargs)
  10. File "/root/anaconda3/envs/vllm/lib/python3.9/site-packages/transformers/models/auto/tokenization_auto.py", line 534, in get_tokenizer_config
  11. resolved_config_file = cached_file(
  12. File "/root/anaconda3/envs/vllm/lib/python3.9/site-packages/transformers/utils/hub.py", line 429, in cached_file
  13. resolved_file = hf_hub_download(
  14. File "/root/anaconda3/envs/vllm/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 110, in _inner_fn
  15. validate_repo_id(arg_value)
  16. File "/root/anaconda3/envs/vllm/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 158, in validate_repo_id
  17. raise HFValidationError(
  18. huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': 'EmbeddingModel/BERT/reberta-large'. Use `repo_type` argument if needed.

使用本地模型进行BERTScore指标计算时,请确认路径是否正确,如果模型路径不存在,会产生报错:

huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name'

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/362992
推荐阅读
相关标签
  

闽ICP备14008679号