File tree Expand file tree Collapse file tree 4 files changed +75
-0
lines changed Expand file tree Collapse file tree 4 files changed +75
-0
lines changed Original file line number Diff line number Diff line change
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
+
1
21
from transformers import TFBertForSequenceClassification , BertTokenizer , BertConfig
2
22
from tpu_utils import get_tpu
3
23
from tpu_dataset import create_dataset
Original file line number Diff line number Diff line change
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
+
1
19
from tpu_utils import get_tpu
2
20
import tensorflow as tf
3
21
from transformers import TFBertForSequenceClassification , BertTokenizer , glue_convert_examples_to_features
Original file line number Diff line number Diff line change
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
+
1
19
import tensorflow as tf
2
20
from transformers import glue_convert_examples_to_features , glue_processors
3
21
Original file line number Diff line number Diff line change
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
+
1
20
import tensorflow as tf
2
21
3
22
You can’t perform that action at this time.
0 commit comments