"vscode:/vscode.git/clone" did not exist on "9edfdaec7bc75da48326113283b4af1693df1abb"
Unverified Commit 5cd8d7ad authored by Thomas Wolf's avatar Thomas Wolf Committed by GitHub
Browse files

Merge pull request #16 from donatasrep/master

Excluding AdamWeightDecayOptimizer internal variables from restoring
parents 278fd28a 20d07b3a
......@@ -68,11 +68,17 @@ def convert():
arrays.append(array)
for name, array in zip(names, arrays):
name = name[5:] # skip "bert/"
if not name.startswith("bert"):
print("Skipping {}".format(name))
continue
else:
name = name.replace("bert/", "") # skip "bert/"
print("Loading {}".format(name))
name = name.split('/')
if name[0] in ['redictions', 'eq_relationship']:
print("Skipping")
# adam_v and adam_m are variables used in AdamWeightDecayOptimizer to calculated m and v
# which are not required for using pretrained model
if name[0] in ['redictions', 'eq_relationship'] or name[-1] == "adam_v" or name[-1] == "adam_m":
print("Skipping {}".format("/".join(name)))
continue
pointer = model
for m_name in name:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment