Fix F821 flake8 warning (x47).
Ignore warnings related to Python 2, because it's going away soon.
This commit is contained in:
@@ -68,6 +68,14 @@ TF_XXX_PRETRAINED_MODEL_ARCHIVE_MAP = {
|
||||
#
|
||||
# See the conversion methods in modeling_tf_pytorch_utils.py for more details
|
||||
####################################################
|
||||
|
||||
TFXxxAttention = tf.keras.layers.Layer
|
||||
|
||||
TFXxxIntermediate = tf.keras.layers.Layer
|
||||
|
||||
TFXxxOutput = tf.keras.layers.Layer
|
||||
|
||||
|
||||
class TFXxxLayer(tf.keras.layers.Layer):
|
||||
def __init__(self, config, **kwargs):
|
||||
super(TFXxxLayer, self).__init__(**kwargs)
|
||||
@@ -316,6 +324,9 @@ class TFXxxModel(TFXxxPreTrainedModel):
|
||||
return outputs
|
||||
|
||||
|
||||
TFXxxMLMHead = tf.keras.layers.Layer
|
||||
|
||||
|
||||
@add_start_docstrings(
|
||||
"""Xxx Model with a `language modeling` head on top. """, XXX_START_DOCSTRING, XXX_INPUTS_DOCSTRING
|
||||
)
|
||||
|
||||
@@ -135,6 +135,14 @@ def load_tf_weights_in_xxx(model, config, tf_checkpoint_path):
|
||||
#
|
||||
# See the conversion methods in modeling_tf_pytorch_utils.py for more details
|
||||
####################################################
|
||||
|
||||
XxxAttention = nn.Module
|
||||
|
||||
XxxIntermediate = nn.Module
|
||||
|
||||
XxxOutput = nn.Module
|
||||
|
||||
|
||||
class XxxLayer(nn.Module):
|
||||
def __init__(self, config):
|
||||
super(XxxLayer, self).__init__()
|
||||
@@ -160,6 +168,16 @@ class XxxLayer(nn.Module):
|
||||
# pointers for your model and the weights initialization
|
||||
# method if its not fully covered by PreTrainedModel's default method
|
||||
####################################################
|
||||
|
||||
XxxLayerNorm = torch.nn.LayerNorm
|
||||
|
||||
XxxEmbeddings = nn.Module
|
||||
|
||||
XxxEncoder = nn.Module
|
||||
|
||||
XxxPooler = nn.Module
|
||||
|
||||
|
||||
class XxxPreTrainedModel(PreTrainedModel):
|
||||
""" An abstract class to handle weights initialization and
|
||||
a simple interface for dowloading and loading pretrained models.
|
||||
|
||||
Reference in New Issue
Block a user