Skip to content

Commit 111bf7c

Browse files
committed
Credit where it's due
1 parent 98cbe5c commit 111bf7c

File tree

4 files changed

+75
-0
lines changed

4 files changed

+75
-0
lines changed

examples/TPU/run_tpu_glue.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
# coding=utf-8
2+
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
""" === Under active development === Script to fine-tune GLUE on a TPU
16+
17+
Adapted from https://github.com/tensorflow/models
18+
Especially https://github.com/tensorflow/models/blob/master/official/modeling/model_training_utils.py
19+
"""
20+
121
from transformers import TFBertForSequenceClassification, BertTokenizer, BertConfig
222
from tpu_utils import get_tpu
323
from tpu_dataset import create_dataset

examples/TPU/run_tpu_glue_fit.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# coding=utf-8
2+
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
""" === Under active development === Script to fine-tune GLUE on a TPU using keras' fit method
16+
"""
17+
18+
119
from tpu_utils import get_tpu
220
import tensorflow as tf
321
from transformers import TFBertForSequenceClassification, BertTokenizer, glue_convert_examples_to_features

examples/TPU/tpu_dataset.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# coding=utf-8
2+
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
""" === Under active development === Dataset load
16+
"""
17+
18+
119
import tensorflow as tf
220
from transformers import glue_convert_examples_to_features, glue_processors
321

examples/TPU/tpu_utils.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# coding=utf-8
2+
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
""" === Under active development === Loading a TPUStrategy
16+
17+
Especially https://github.com/GoogleCloudPlatform/training-data-analyst/blob/tf2/courses/fast-and-lean-data-science/01_MNIST_TPU_Keras.ipynb
18+
"""
19+
120
import tensorflow as tf
221

322

0 commit comments

Comments
 (0)