facebookresearch / fairseq

Facebook AI Research Sequence-to-Sequence Toolkit written in Python.
MIT License
29.75k stars 6.3k forks source link

Training a model with a custom FairseqDataset implementation #5492

Closed sidharthrajaram closed 1 month ago

sidharthrajaram commented 2 months ago

❓ Questions and Help

Before asking:

What is your question?

I have extended FairseqDataset and created a custom dataset implementation. How do I use this custom implementation to train against some particular model architecture using fairseq-train?

What have you tried?

Read the docs regarding Tasks and have a feeling that's the direction to go. Still curious about the extent to which the CLI tool fairseq-train can be used.

What's your environment?

sidharthrajaram commented 1 month ago

For anyone encountering the same issue, it probably varies quite a bit depending on your dataset, but I had to implement custom Task and FairseqDataset classes and then override setup_task() and load_dataset() behavior in my custom Task class.