# \[SOLVED\] DONUT Fine-tuning error, following documentation

**URL:** <https://discuss.huggingface.co/t/solved-donut-fine-tuning-error-following-documentation/93799>\
**Category:** Beginners\
**Created:** [June 24, 2024, 3:09pm UTC](https://discuss.huggingface.co/t/solved-donut-fine-tuning-error-following-documentation/93799 "2024-06-24T15:09:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mayonnaisu](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@Mayonnaisu](https://discuss.huggingface.co/u/Mayonnaisu)\
**Post date:** [June 24, 2024, 3:09pm UTC](https://discuss.huggingface.co/t/solved-donut-fine-tuning-error-following-documentation/93799/1 "2024-06-24T15:09:00Z")

</div>

Hi!

Ive been following the guide by Niels: [Transformers-Tutorials/Donut/CORD/Fine\_tune\_Donut\_on\_a\_custom\_dataset\_(CORD)\_with\_PyTorch\_Lightning.ipynb at master · NielsRogge/Transformers-Tutorials · GitHub](https://github.com/NielsRogge/Transformers-Tutorials/blob/master/Donut/CORD/Fine_tune_Donut_on_a_custom_dataset_(CORD)_with_PyTorch_Lightning.ipynb)

I am running the code as in in Google Colab, except changing max\_epochs to 1 to make it faster.  
In the cell where it starts the training:  
the trainer = pl.Trainer(…)  
trainer.fit(model\_module)

I get an error:

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/8/1/812aef4ae4953a9193934f562e19a175cb8c41c0.png)

EDIT-  
Ah, solved, stupid me. Seems to be a typo in the documentation, missing the parenthesis like the error suggested…  
This solved it:  
pred = re.sub(r"(?:(?\<=\>) | (?=))", “”, answer, count=1)

Thanks!
