cnn_yor_ner / custom_modeling.py
Testys's picture
Upload folder using huggingface_hub
dfe40cb verified
raw
history blame contribute delete
388 Bytes
from transformers import AutoConfig, AutoModel
from modeling_cnn_ner import CNNForNER
def get_model(pretrained_model_name_or_path):
config = AutoConfig.from_pretrained(pretrained_model_name_or_path)
model = CNNForNER(
pretrained_model_name=config.pretrained_model_name,
num_classes=config.num_classes,
max_length=config.max_length
)
return model