# How to rewrite this code?

**URL:** <https://discuss.huggingface.co/t/how-to-rewrite-this-code/96698>\
**Category:** 🤗Transformers\
**Created:** [July 11, 2024, 12:01am UTC](https://discuss.huggingface.co/t/how-to-rewrite-this-code/96698 "2024-07-11T00:01:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blackmagic02881](https://avatars.discourse-cdn.com/v4/letter/b/e47c2d/32.png) [@blackmagic02881](https://discuss.huggingface.co/u/blackmagic02881)\
**Post date:** [July 11, 2024, 12:01am UTC](https://discuss.huggingface.co/t/how-to-rewrite-this-code/96698/1 "2024-07-11T00:01:05Z")

</div>

Saw this great blog and tried to reproduce it. [Fine-tuning Florence-2 - Microsoft's Cutting-edge Vision Language Models](https://huggingface.co/blog/finetune-florence2)  
The blog handwrites the train step. I noticed that transformer.Trainer() only take tokenizer as parameter. Wonder if something similar to Trainer() can take a processor?
