vocab_size missing in IndicTransConfig β€” breaking generation in latest Transformers

#9
by Aditya232003 - opened

Hi AI4Bharat Team,

I'm using the ai4bharat/indictrans2-en-indic-1B model for a thesis project. Until recently, everything worked perfectly, both in local and Colab environments. However, after a recent update, the model is throwing the following error during generate():

AttributeError: 'IndicTransConfig' object has no attribute 'vocab_size'

This appears to be because vocab_size is missing in the current config.json, and Hugging Face's generate() relies on it during beam search. This breaks all downstream use of the model β€” even simple batch translations fail.

Steps I’ve tried:

  • Patching config.json manually (adding vocab_size key).
  • Downgrading transformers + huggingface_hub.
  • Trying old revisions (which now 404).
  • Using both CPU and GPU environments β€” same issue.

This issue is critical for me as my final presentation is next week (I'm a final year student at Trinity College Dublin). Please advise if:

  • An older working snapshot can be restored.
  • The vocab_size can be reintroduced in config or handled in code.

Thanks again for the incredible work with IndicTrans2 β€” this model is genuinely important for bridging language barriers.

Best regards,
Aditya

This has been resolved.

pranjalchitale changed discussion status to closed

Sign up or log in to comment