To use the latest version of the transformers
library in a SageMaker DLC you don’t have to provide a custome inference script, just a requirements.txt
file with a line that says transformers==4.23.1
. The DLC will then install/update to the specified transformers version.
This example & this documentation show how to do that, hope that helps.