OSError: Model name ‘E:/pretrained_models/chinese-bert-wwm-ext’ was not found in tokenizers model name list (bert-base-uncased, bert-large-uncased, bert-base-cased, bert-large-cased, bert-base-multilingual-uncased, bert-base-multilingual-cased, bert-base-chinese, bert-base-german-cased, bert-large-uncased-whole-word-masking, bert-large-cased-whole-word-masking, bert-large-uncased-whole-word-masking-finetuned-squad, bert-large-cased-whole-word-masking-finetuned-squad, bert-base-cased-finetuned-mrpc, bert-base-german-dbmdz-cased, bert-base-german-dbmdz-uncased, TurkuNLP/bert-base-finnish-cased-v1, TurkuNLP/bert-base-finnish-uncased-v1, wietsedv/bert-base-dutch-cased). We assumed ‘E:/pretrained_models/chinese-bert-wwm-ext’ was a path, a model identifier, or url to a directory containing vocabulary files named [‘vocab.txt’] but couldn’t find such vocabulary files at this path or url.
往往是torchserve里面的模型文件路径没有对应上,tmp就是docker生产的所在目录 生成模型的时候,extra-files可以直接指定总文件目录,以是的本地的路径和torchserve里面的路径一致,防止报错
torch-model-archiver --model-name epidemic_hsy --version 1.0 --serialized-file ./tplinker_plus1/default_log_dir/model_best/model_state_dict_best.pt --export-path model-store --handler ./tplinker_plus1/handler_epidemic_ner.py --extra-files "./tplinker_plus1" -f
|