daboliang:

CustomClass(config, 100)


CustomClass.from_pretrained didnt work for me, and still getting the same error. Not sure why from_pretrained isn’t inherited as a class method.
But this “seems” to work. Strange it didnt need from_pretrained but just instantiate a model. I read it somewhere loading with config wont load weights, so I suspect it is still NOT done.
cfg = PretrainedConfig.from_pretrained('./PATH/')
model = CustomClass(cfg, num_labels=100)