Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
5a898973
Commit
5a898973
authored
Mar 09, 2021
by
Frederick Liu
Committed by
A. Unique TensorFlower
Mar 09, 2021
Browse files
Internal change
PiperOrigin-RevId: 361957289
parent
7e3d5270
Changes
267
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
20 deletions
+19
-20
official/nlp/xlnet/run_classifier.py
official/nlp/xlnet/run_classifier.py
+2
-2
official/nlp/xlnet/run_pretrain.py
official/nlp/xlnet/run_pretrain.py
+2
-2
official/nlp/xlnet/run_squad.py
official/nlp/xlnet/run_squad.py
+2
-2
official/nlp/xlnet/squad_utils.py
official/nlp/xlnet/squad_utils.py
+3
-3
official/nlp/xlnet/training_utils.py
official/nlp/xlnet/training_utils.py
+6
-7
official/nlp/xlnet/xlnet_config.py
official/nlp/xlnet/xlnet_config.py
+2
-2
official/nlp/xlnet/xlnet_modeling.py
official/nlp/xlnet/xlnet_modeling.py
+2
-2
No files found.
official/nlp/xlnet/run_classifier.py
View file @
5a898973
# Copyright 201
9
The TensorFlow Authors. All Rights Reserved.
# Copyright 20
2
1 The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# ==============================================================================
"""XLNet classification finetuning runner in tf2.0."""
"""XLNet classification finetuning runner in tf2.0."""
import
functools
import
functools
...
...
official/nlp/xlnet/run_pretrain.py
View file @
5a898973
# Copyright 201
9
The TensorFlow Authors. All Rights Reserved.
# Copyright 20
2
1 The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# ==============================================================================
"""XLNet pretraining runner in tf2.0."""
"""XLNet pretraining runner in tf2.0."""
import
functools
import
functools
...
...
official/nlp/xlnet/run_squad.py
View file @
5a898973
# Copyright 201
9
The TensorFlow Authors. All Rights Reserved.
# Copyright 20
2
1 The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# ==============================================================================
"""XLNet SQUAD finetuning runner in tf2.0."""
"""XLNet SQUAD finetuning runner in tf2.0."""
import
functools
import
functools
...
...
official/nlp/xlnet/squad_utils.py
View file @
5a898973
# Copyright 201
9
The TensorFlow Authors. All Rights Reserved.
# Copyright 20
2
1 The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# ==============================================================================
# coding=utf-8
# coding=utf-8
"""Utilities used in SQUAD task."""
"""Utilities used in SQUAD task."""
from
__future__
import
absolute_import
from
__future__
import
absolute_import
...
@@ -656,7 +656,7 @@ def convert_examples_to_features(examples, sp_model, max_seq_length, doc_stride,
...
@@ -656,7 +656,7 @@ def convert_examples_to_features(examples, sp_model, max_seq_length, doc_stride,
assert
tok_start_position
<=
tok_end_position
assert
tok_start_position
<=
tok_end_position
def
_piece_to_id
(
x
):
def
_piece_to_id
(
x
):
if
six
.
PY2
and
isinstance
(
x
,
unicode
):
if
six
.
PY2
and
isinstance
(
x
,
unicode
):
# pylint: disable=undefined-variable
x
=
x
.
encode
(
"utf-8"
)
x
=
x
.
encode
(
"utf-8"
)
return
sp_model
.
PieceToId
(
x
)
return
sp_model
.
PieceToId
(
x
)
...
...
official/nlp/xlnet/training_utils.py
View file @
5a898973
# Copyright 201
9
The TensorFlow Authors. All Rights Reserved.
# Copyright 20
2
1 The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
@@ -11,22 +11,21 @@
...
@@ -11,22 +11,21 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# ==============================================================================
"""XLNet training utils."""
"""XLNet training utils."""
import
os
import
os
import
re
import
re
from
typing
import
Any
,
Callable
,
Dict
,
Optional
,
Text
from
absl
import
logging
from
absl
import
logging
# pytype: disable=attribute-error
# pylint: disable=g-bare-generic,unused-import
import
tensorflow
as
tf
import
tensorflow
as
tf
from
typing
import
Any
,
Callable
,
Dict
,
Text
,
Optional
from
official.nlp.bert
import
model_training_utils
from
official.nlp.bert
import
model_training_utils
from
official.nlp.xlnet
import
data_utils
from
official.nlp.xlnet
import
data_utils
from
official.nlp.xlnet
import
xlnet_modeling
as
modeling
# pytype: disable=attribute-error
# pylint: disable=g-bare-generic,unused-import
_MIN_SUMMARY_STEPS
=
10
_MIN_SUMMARY_STEPS
=
10
...
...
official/nlp/xlnet/xlnet_config.py
View file @
5a898973
# Copyright 201
9
The TensorFlow Authors. All Rights Reserved.
# Copyright 20
2
1 The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# ==============================================================================
"""Utility functions used in XLNet model."""
"""Utility functions used in XLNet model."""
import
json
import
json
...
...
official/nlp/xlnet/xlnet_modeling.py
View file @
5a898973
# Copyright 201
9
The TensorFlow Authors. All Rights Reserved.
# Copyright 20
2
1 The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# ==============================================================================
"""Keras layers of XLNet model in TF 2.0."""
"""Keras layers of XLNet model in TF 2.0."""
import
copy
import
copy
...
...
Prev
1
…
10
11
12
13
14
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment