Skip to content
This repository was archived by the owner on Sep 25, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,18 +302,18 @@ def get_activation(activation_string):
return None

act = activation_string.lower()
if act == "linear":
return None
elif act == "relu":
return tf.nn.relu
elif act == "gelu":
return gelu
elif act == "tanh":
return tf.tanh
else:
mapping_dict = {
"linear": None,
"relu": tf.nn.relu,
"gelu": gelu,
"tanh": tf.tanh,
}

try:
return mapping_dict[act]
except Exception as e:
raise ValueError("Unsupported activation: %s" % act)


def get_assignment_map_from_checkpoint(tvars, init_checkpoint):
"""Compute the union of the current variables and checkpoint variables."""
assignment_map = {}
Expand Down