Downloads · 30 days
0
marsggbo/OpenMoE
OpenMoE is a machine learning model from marsggbo. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
Downloads · 30 days
0
Access
Public
Updated Dec 18, 2023
Repo size
3.2 GB
Likes
0
Public
Click a slice to open those files.
.pth3.2 GB · 100%
From the Hugging Face model README
git clone https://github.com/marsggbo/ColossalAI
cd ColossalAI
pip install -e .
from transformers import T5Tokenizer
from transformers.models.llama import LlamaConfig
config = LlamaConfig.from_pretrained(f"hpcaitech/openmoe-base")
model = OpenMoeForCausalLM(config)
ckpt = torch.load("openmoe_base_yizhongw_super_natural_instruction_generation.pth")
state_dict = {}
for key, value in ckpt.items():
if key.startswith("module."):
state_dict[key[7:]] = value
else:
state_dict[key] = value
model.load_state_dict(state_dict)