This question seems to be specific to the HuggingFace repository, so could you explain what AutoTokenizer returns? As it doesn’t seem to be a plain nn.Module, I guess it might be a custom class? If so, could you check if this custom object defines the expected __init__ and forward methods?