Distilbert Seq2clas
HelloI have two questions:1 We can  view the. pooled layer by using  output_hidden_states=true and follow the logic, but is there a  generic way to do so?2 When we are doing inference, can we output the hidden_states from trainer.predict() as we do by model(input/output_hidden_states=True)?Thanks
2021-07-18T10:59:29Z
I have a similar doubt as regards point 2.I am working on Question Answering with Distilbert.The predict function in the Trainer does not work if output_hidden_states = True. It works fine if the same argument is set to False.Is this a bug? If not, then how  is one to use a model for prediction if one has set the argument output_hidden_states = True while initializing the model ?
2021-07-18T12:01:09Z
Found the solution. Posting it here just in case someone else too gets stuck with my particular problem.I just had to pass ignore_keys = [‘attentions’] in the predict function and everything works fine.
2021-07-18T12:22:45Z
@natankTo answer your second question, I don’t think so because as seen in the predict function source code, it only returns predictions, label_ids and metrics.trainer_predict1052×668 31.2 KB
2021-07-19T11:53:32Z
Thanks for you replies. Regarding one it indeed resolved me a problem. Regarding your answer on q2. It seems that Huggingsface offer two working modes, research : use model , and model taining - use predict. Am I right?