Views
No views yet
1git clone https://github.com/marsggbo/ColossalAI
2cd ColossalAI
3pip install -e .1from transformers import T5Tokenizer
2from transformers.models.llama import LlamaConfig
3
4config = LlamaConfig.from_pretrained(f"hpcaitech/openmoe-base")
5model = OpenMoeForCausalLM(config)
6ckpt = torch.load("openmoe_base_yizhongw_super_natural_instruction_generation.pth")
7state_dict = {}
8for key, value in ckpt.items():
9 if key.startswith("module."):
10 state_dict[key[7:]] = value
11 else:
12 state_dict[key] = value
13model.load_state_dict(state_dict)