Is there a way I can use Transformers 3.1.0 in SageMaker?

I’m trying to use the following package in SageMaker: GitHub - georgian-io/Multimodal-Toolkit: Multimodal model for text and tabular data with HuggingFace t

I’m actually not sure if it will be possible unless I make a PR to make it work with Transformers 4.6.1 or I build my own multimodal network.

They used Transformers 3.1.0 and haven’t updated it since. Is there a way around this so that I can use multimodal transformers in SageMaker?


Hey @JacquesThibs,

Sadly there is no DLC for version 3.1.0 the first DLC contains transformers 4.4.2.

Could elaborate a bit more on what you want to do? Maybe can find a workaround.
Additionally, it is always possible to provide a custom requirements.txt where you could downgrade transformers to 3.1.0.
Do you want to use this for training or inference?

Hey @philschmid thanks for the response!

Yeah, I noticed that the DLCs are only for newer versions of transformers, but I was hoping there would be a way around if I only needed the library for certain parts, not sure. I’m currently doing this for a SageMaker course, but it would be “easier” to use transformers 3.1.0 if I used my own Docker container and spin up an EC2 instance, right?

Anyway, what I’m trying to do is to train and do inference on a multimodal model. I could build my own multimodal model, but since I’m only doing this to learn SageMaker, I was hoping there would be an easier way to do it.

I’m working with a multitask dataset with additional tabular data, which is why I’m trying to use a multimodal tabular model.

When I do pip install multimodal-transformers, it installs transformers 3.1.0, but I’m not sure will work… I’ve been running into some other dependency issues so I haven’t been able to try it out for training yet.

What are you saying I should provide the requirements.txt file to?


Thank you for all this information.

If you want to do this to learn how to use SageMaker I definitely suggest building an NLP model and then integrate it afterwards into your multimodal data.

If you still want to use the multimodal-transformers you could create a requirements.txt in the same directory as your entry_point SageMaker will then install these requirements before running your training.

And for your inference, you can take a look here at how to build custom Deploy models to Amazon SageMaker

1 Like

Thanks @philschmid! I knew that was possible and it was the first thing I was going to try, but transformers will still work if I do that, even if it downgrades to 3.1.0? I’ll try it out. Thanks!