# Merging two models

**URL:** <https://discuss.huggingface.co/t/merging-two-models/76641>\
**Category:** 🤗Transformers\
**Created:** [March 9, 2024, 9:45am UTC](https://discuss.huggingface.co/t/merging-two-models/76641 "2024-03-09T09:45:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon36591061](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@anon36591061](https://discuss.huggingface.co/u/anon36591061)\
**Post date:** [March 9, 2024, 9:45am UTC](https://discuss.huggingface.co/t/merging-two-models/76641/1 "2024-03-09T09:45:22Z")

</div>

How to merge two models from huggingface? ex. text classification and conversation model.

---

<div class="post-metadata">

**Author:** ![Thytu](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/thytu/32/57554_2.png) [@Thytu](https://discuss.huggingface.co/u/Thytu)\
**Post date:** [March 9, 2024, 10:41am UTC](https://discuss.huggingface.co/t/merging-two-models/76641/2 "2024-03-09T10:41:24Z")

</div>

Hey,

I would go with this [mergekit](https://github.com/arcee-ai/mergekit) library, it contains the main merging methods 🙂  
Also if you’re interested into the underworking of those algorithm, I wrote a [blog post](https://thytu.com/posts/editing-models-with-task-arithmetic/) explaining the basics of [Task Arithmetic](https://arxiv.org/abs/2212.04089).

Hope that can help 🙌
