"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "11cb6e0f7eb48bf973595eb42e827b89831704ab"
Unverified Commit 080e42d0 authored by Stas Bekman's avatar Stas Bekman Committed by GitHub
Browse files

[megatron-bert-uncased-345m] fix conversion (#16639)

parent 09a272b0
...@@ -300,6 +300,10 @@ def main(): ...@@ -300,6 +300,10 @@ def main():
if args.config_file == "": if args.config_file == "":
# Default config of megatron-bert 345m # Default config of megatron-bert 345m
config = MegatronBertConfig() config = MegatronBertConfig()
# different megatron-bert-*-345m models have different vocab sizes, so override the default
# config (which is for megatron-bert-cased-345m) with the actual vocab dimension
config.vocab_size = input_state_dict["model"]["lm_head"]["bias"].numel()
else: else:
config = MegatronBertConfig.from_json_file(args.config_file) config = MegatronBertConfig.from_json_file(args.config_file)
......
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