salesforce / CodeT5

Home of CodeT5: Open Code LLMs for Code Understanding and Generation
https://arxiv.org/abs/2305.07922
BSD 3-Clause "New" or "Revised" License
2.68k stars 394 forks source link

Loss in run_gen.py #38

Closed blurLake closed 2 years ago

blurLake commented 2 years ago

Hi, I am trying to figure out how the loss is calculated, for example here. I assume it is some distance between generated_ids and target_ids with attention_masks, but could you point it out how the code and formula look like? Thank you very much!

yuewang-cuhk commented 2 years ago

HI, as CodeT5 is adapted from Huggingface's T5 implementation, you should refer to official documentations like here.