Skip to content

Commit

Permalink
Fix non-negligible difference between GPT2 and TFGP2 (#13679)
Browse files Browse the repository at this point in the history
Co-authored-by: ydshieh <[email protected]>
  • Loading branch information
ydshieh and ydshieh authored Sep 22, 2021
1 parent a0c08aa commit 93624bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/models/gpt2/modeling_tf_gpt2.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def __init__(self, n_state, config, **kwargs):
nx = config.n_embd
self.c_fc = TFConv1D(n_state, nx, initializer_range=config.initializer_range, name="c_fc")
self.c_proj = TFConv1D(nx, n_state, initializer_range=config.initializer_range, name="c_proj")
self.act = get_tf_activation("gelu")
self.act = get_tf_activation(config.activation_function)
self.dropout = tf.keras.layers.Dropout(config.resid_pdrop)

def call(self, x, training=False):
Expand Down

0 comments on commit 93624bf

Please sign in to comment.