Update for compatibility with transformers >= 0.4.