具体报错情况如下:
huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': './bert/bert_base_cased_ICEWS14'. Userepo_typeargument if needed.

很简单,我download下来的代码没有并没有模型参数的文件,所以去https://huggingface.co/bert-base-cased/tree/main下载然后放到文件夹里就好了。

注意BertTokenizerFast.from_pretrained里面放的是模型参数文件所在的文件夹而不是文件本身。
在这里插入图片描述

GitHub 加速计划 / be / bert
16
2
下载
TensorFlow code and pre-trained models for BERT
最近提交(Master分支:4 个月前 )
eedf5716 Add links to 24 smaller BERT models. 5 年前
8028c045 - 5 年前
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐