Open unose opened 5 months ago
Hi @unose ,
I'm very sorry, I think I made the mistake of uploading a later version I was using which removed the "CLS" branch from the forward function of the model. I will upload the updated version as soon as possible.
Thank you so much for your consideration.
The below code snippets are simplified for highlighting only the control flow by the function execution
set_model_mode()
, where the first taskTASK_CODE_AST_PREDICTION
changes the mode toMODEL_MODE_CLS
and the next two tasks switch the mode toMODEL_MODE_GEN
.When running the program, the mode
MODEL_MODE_GEN
for those two tasks worked well. However, the modeMODEL_MODE_CLS
configured by the taskTASK_CODE_AST_PREDICTION
caused the runtime error which was triggered from theforward()
function in the classBartForClassificationAndGeneration
. In this function, the modeMODEL_MODE_GEN
in theIF
conditional expression (CODE LINK) only executed the next functionforward_gen()
without any error.pre_train.py
bart.py
Environment:
Command:
Error message:
As shown below, there is only one location in the source files to set the model mode
MODEL_MODE_CLS
and others useMODEL_MODE_GEN
through the functionset_model_mode()
.I want to understand the case that TASK_CODE_AST_PREDICTION changes the mode to MODEL_MODE_CLS in pre_train.py (line 153). I wonder if there was something I missed. The other 2 pre-training tasks worked well.