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:
Matt
2023-06-02 15:28:52 +01:00
committed by GitHub
parent c9cf337772
commit 167a0d8f87
23 changed files with 54 additions and 31 deletions

View File

@@ -235,8 +235,10 @@ def main(args):
num_warmup_steps=total_train_steps // 20,
init_lr=args.learning_rate,
weight_decay_rate=args.weight_decay_rate,
# TODO Add the other Adam parameters?
)
# 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=["accuracy"])
def decode_fn(example):