Unverified Commit 35c04596 authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Fix `main_input_name` in `src/transformers/keras_callbacks.py` (#24916)



fix
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent 85514c17
......@@ -193,7 +193,6 @@ class KerasMetricCallback(Callback):
# This dense conditional recognizes the case where we have an encoder-decoder model, but
# avoids getting tangled up when we just have a model with a layer called 'encoder'
if hasattr(self.model, "encoder") and hasattr(self.model.encoder, "main_input_name"):
if self.model.encoder.main_input_name != self.model.main_input_name:
main_input_name = self.model.encoder.main_input_name
else:
main_input_name = getattr(self.model, "main_input_name", "input_ids")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment