# Training General Pytorch model with HuggingFace's Trainer

**URL:** <https://discuss.huggingface.co/t/training-general-pytorch-model-with-huggingfaces-trainer/38995>\
**Category:** 🤗Transformers\
**Created:** [May 7, 2023, 5:05pm UTC](https://discuss.huggingface.co/t/training-general-pytorch-model-with-huggingfaces-trainer/38995 "2023-05-07T17:05:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ransaka](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ransaka/32/15946_2.png) [@Ransaka](https://discuss.huggingface.co/u/Ransaka)\
**Post date:** [May 7, 2023, 5:05pm UTC](https://discuss.huggingface.co/t/training-general-pytorch-model-with-huggingfaces-trainer/38995/1 "2023-05-07T17:05:41Z")

</div>

Hello,

I was wondering if we could utilize HuggingFace’s Trainer API to train the PyTorch model. In PyTorch Lightning, we can conveniently adapt our existing PyTorch model by inheriting the PyTorch model with Pt Lightning Module regardless of the model architecture. If this is possible, could someone kindly recommend a helpful resource?

Thanks in advance,  
Ransaka
