Fix deprecation warnings with transformers < 4