# Fine Tunning a Model for JSON output

**URL:** <https://discuss.huggingface.co/t/fine-tunning-a-model-for-json-output/73727>\
**Category:** Models\
**Created:** [February 18, 2024, 6:57pm UTC](https://discuss.huggingface.co/t/fine-tunning-a-model-for-json-output/73727 "2024-02-18T18:57:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arjun20398](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@Arjun20398](https://discuss.huggingface.co/u/Arjun20398)\
**Post date:** [February 18, 2024, 6:57pm UTC](https://discuss.huggingface.co/t/fine-tunning-a-model-for-json-output/73727/1 "2024-02-18T18:57:04Z")

</div>

I’m trying to fine-tune a language model for dataset like  
[azizshaw/text\_to\_json · Datasets at Hugging Face](https://huggingface.co/datasets/azizshaw/text_to_json) where I will have only two fields input and output where output will be a JSON format. I trained a t5-small and t5-base but it did not give me desired results. Which models should I try for this use case?

---

<div class="post-metadata">

**Author:** ![keithfable](https://avatars.discourse-cdn.com/v4/letter/k/85f322/32.png) [@keithfable](https://discuss.huggingface.co/u/keithfable)\
**Post date:** [June 10, 2024, 6:00pm UTC](https://discuss.huggingface.co/t/fine-tunning-a-model-for-json-output/73727/2 "2024-06-10T18:00:41Z")

</div>

One possible problem with that dataset is that the example outputs all use single quote delimiters, which is not valid JSON.

---

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](https://discuss.huggingface.co/u/nielsr)\
**Post date:** [June 10, 2024, 7:11pm UTC](https://discuss.huggingface.co/t/fine-tunning-a-model-for-json-output/73727/3 "2024-06-10T19:11:15Z")

</div>

Hi,

I do have tutorial notebooks to fine-tune multimodal models on image-\>JSON use cases, might be helpful (on the [CORD](https://huggingface.co/datasets/naver-clova-ix/cord-v2) dataset). Created the same one for different models:

- PaliGemma: [https://github.com/NielsRogge/Transformers-Tutorials/tree/master/paligemma](https://github.com/NielsRogge/Transformers-Tutorials/tree/master/paligemma)
- LLaVa: [https://github.com/NielsRogge/Transformers-Tutorials/tree/master/llava](https://github.com/NielsRogge/Transformers-Tutorials/tree/master/llava)
- Idefics2: [Transformers-Tutorials/Idefics2 at master · NielsRogge/Transformers-Tutorials · GitHub](https://github.com/NielsRogge/Transformers-Tutorials/tree/master/Idefics2).

Should be the same for LLMs.
