New TF GLUE example (#12028)

* Pushing partially-complete new GLUE example

* First draft of the new TF GLUE example! Needs a little more testing to be sure but it's almost ready.

* Fix to the fit() call

* Bugfixes, making sure TPU and multi-GPU support is ready

* Remove logger line that depends on Pytorch

* Style pass

* Deleting old TF GLUE example

* Include label2id and id2label in the saved model config

* Don't clobber the existing model.config.label2id

* Style fixes

* Update examples/tensorflow/text-classification/run_glue.py

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
This commit is contained in:
Matt
2021-06-10 14:14:37 +01:00
committed by GitHub
parent 9d2cee8b48
commit 73a532651a
3 changed files with 558 additions and 269 deletions

View File

@@ -205,7 +205,6 @@ class ModelArguments:
"with private models)."
},
)
tpu: Optional[str] = field(default=None, metadata={"help": "Name of the TPU resource to use, if available"})
# endregion
@@ -439,10 +438,8 @@ def main():
model.compile(optimizer=optimizer, loss=loss_fn, metrics=metrics)
# endregion
# region Convert data to TF format
# region Convert data to a tf.data.Dataset
# Convert data to a tf.keras.utils.Sequence object for training if we're not using a TPU
# For TPU, convert to a tf.data.Dataset
tf_data = dict()
max_samples = {
"train": data_args.max_train_samples,