How can I introspect the input and output keys for an arbitrary model?
I managed to introspect the input keys that a model expects by checkingmodel.dummy_inputsdict  (do all models define this reliably? is there a better way?)But I am currently struggling to find a way to determine the output keys.Thedistilbertmodel I am experimenting with returns"logits", but I understand that not all models may output that key?  And also there are config flags (e.g.model.config.output_hidden_states) that would cause additional keys to be output.I’m not sure if this is specifically atransformersquestion or a PyTorch question…
2023-04-21T08:32:10Z
Related… is there a way to introspect which models will need to use thefrom_pretrained(trust_remote_code=True)option when usingAutoModelFrom*?(I mean other than just trying to load it without the flag and get an error and then trying again with it)