# How is transfomers\_verion and pytorch\_version determined

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-is-transfomers-verion-and-pytorch-version-determined%2F25802%3E%5C
**Category:** Amazon SageMaker\
**Created:** [November 9, 2022, 12:54pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-is-transfomers-verion-and-pytorch-version-determined%2F25802 "2022-11-09T12:54:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![smileeok](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@smileeok](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsmileeok)%5C
**Post date:** [November 9, 2022, 12:54pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-is-transfomers-verion-and-pytorch-version-determined%2F25802%2F1 "2022-11-09T12:54:13Z")

</div>

When submitting to Sagemaker, the hub gives us some sample snippet:

```auto
huggingface_model = HuggingFaceModel(
	transformers_version='4.17.0',
	pytorch_version='1.10.2',
	py_version='py38',
	env=hub,
	role=role, 
)

```

But my model was built with transfomers 4.23.1 and pytorch 1.12.1.

When I used the parameters given by the hub, it can run successfully on certain instance type, however, for `ml.inf1.xlarge`, it complains that it requires `pytorch 1.9.1`. Can we specify these versions arbitrarily? Is there any guidance?

---

<div class="post-metadata">

**Author:** ![marshmellow77](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/marshmellow77/32/3279_2.png) [@marshmellow77](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmarshmellow77)%5C
**Post date:** [November 9, 2022, 1:14pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-is-transfomers-verion-and-pytorch-version-determined%2F25802%2F2 "2022-11-09T13:14:48Z")

</div>

There are different Deep Learning Containers available with different combinations of PyTorch and Transformers, see [here](https://huggingface.co/docs/sagemaker/reference#inference-dlc-overview).

That being said, if you require a specific version for torch and/or transformers and it’s not available in that list you can provide a `requirements.txt` file and specify a specific version number. See also this [post](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdeploying-open-ais-whisper-on-sagemaker%2F24761%2F9)%2C hope that helps.
