# How do I finetune bart for machine translation

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-do-i-finetune-bart-for-machine-translation%2F91135%3E%5C
**Category:** Beginners\
**Created:** [June 9, 2024, 7:10am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-do-i-finetune-bart-for-machine-translation%2F91135 "2024-06-09T07:10:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![heisenberg3376](https://avatars.discourse-cdn.com/v4/letter/h/278dde/32.png) [@heisenberg3376](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fheisenberg3376)%5C
**Post date:** [June 9, 2024, 7:10am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-do-i-finetune-bart-for-machine-translation%2F91135%2F1 "2024-06-09T07:10:22Z")

</div>

I was trying to finetune the “facebook/bart-base” model on a Telugu language dataset. I’ve trained my custom tokenizer and used it. But still the results are not even close to being correct. Here’s the space:

> **[Heisenberg3376 Bert Base Te En - a Hugging Face Space by heisenberg3376](https://huggingface.co/spaces/heisenberg3376/heisenberg3376-bert-base-te-en)**
>
> Discover amazing ML apps made by the community

What do I do? Does the bart model only works fine for European, Slavic languages?  
this is the script:

> **[Google Colab](https://colab.research.google.com/drive/1DfAMYrlEtpoC5MB1pfqeI-ZbPtPKuLp7)**

Please someone help me out!  
Thank You

---

<div class="post-metadata">

**Author:** ![MattiLinnanvuori](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@MattiLinnanvuori](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FMattiLinnanvuori)%5C
**Post date:** [June 9, 2024, 3:19pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-do-i-finetune-bart-for-machine-translation%2F91135%2F2 "2024-06-09T15:19:13Z")

</div>

The documentation says that the BART model works for English. [facebook/bart-base](https://huggingface.co/facebook/bart-base) I think fine-tuning is not enough and you would have to pre-train the model for Telugu.

---

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnielsr)%5C
**Post date:** [June 9, 2024, 7:29pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-do-i-finetune-bart-for-machine-translation%2F91135%2F3 "2024-06-09T19:29:19Z")

</div>

Yes it’s not possible to train a custom tokenizer and then use it with a model which already has a certain vocabulary defined. You would need to also train the model from scratch in case you trained a new tokenizer.

BART itself is an English model indeed, so I’d recommend to start from a different pre-trained model to fine-tune on Telugu, such as M2M100 or NLLB.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/hellohellohello/original/2X/d/de4155eb4aa4108ecb32a1389d7cc37ae69f88b7.png) [@system](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsystem)%5C
**Post date:** [June 10, 2024, 7:29am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-do-i-finetune-bart-for-machine-translation%2F91135%2F4 "2024-06-10T07:29:28Z")

</div>

Closed on June 10, 2024, 7:29am UTC

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
