Open bluesoulo opened 3 years ago
you can also download the models and load them locally. By the way, BertModel. from_pretrained() could work.
you can also download the models and load them locally. By the way, BertModel. from_pretrained() could work.
thanks,i will try it.
The model trueto/medbert-base-chinese
loads with warning:
>>> model = BertModel.from_pretrained('trueto/medbert-base-chinese')
Some weights of the model checkpoint at trueto/medbert-base-chinese were not used when initializing BertModel: ['cls.predictions.decoder.bias', 'cls.seq_relationship.bias', 'cls.predictions.decoder.weight', 'cls.predictions.bias', 'cls.predictions.transform.dense.bias', 'cls.predictions.transform.dense.weight', 'cls.predictions.transform.LayerNorm.weight', 'cls.seq_relationship.weight', 'cls.predictions.transform.LayerNorm.bias']
- This IS expected if you are initializing BertModel from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
- This IS NOT expected if you are initializing BertModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
>>>
However, this model won't work for Named Entity Recognition tasks, right? As its labels are only binary:
>>> model.config.id2label
{0: 'LABEL_0', 1: 'LABEL_1'}
>>>
OSError: Can't load tokenizer for 'trueto/medalbert-base-wwm-chinese'. Make sure that:
'trueto/medalbert-base-wwm-chinese' is a correct model identifier listed on 'https://huggingface.co/models'
or 'trueto/medalbert-base-wwm-chinese' is the correct path to a directory containing relevant tokenizer files