Add an option to reduce compile() console spam (#23938)
* Add an option to reduce compile() console spam * Add annotations to the example scripts * Add notes to the quicktour docs as well * minor fix
This commit is contained in:
@@ -453,6 +453,8 @@ def main():
|
||||
metrics = []
|
||||
else:
|
||||
metrics = ["accuracy"]
|
||||
# Transformers models compute the right loss for their task by default when labels are passed, and will
|
||||
# use this for training unless you specify your own loss function in compile().
|
||||
model.compile(optimizer=optimizer, metrics=metrics, jit_compile=training_args.xla)
|
||||
# endregion
|
||||
|
||||
|
||||
@@ -487,6 +487,8 @@ def main():
|
||||
metrics = []
|
||||
else:
|
||||
metrics = ["accuracy"]
|
||||
# Transformers models compute the right loss for their task by default when labels are passed, and will
|
||||
# use this for training unless you specify your own loss function in compile().
|
||||
model.compile(optimizer=optimizer, metrics=metrics)
|
||||
# endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user