Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why are the names of parameters hard-coded? Is it possible to read it from index.json in HF checkpoints? #460

Open
zhangzx-uiuc opened this issue Nov 21, 2024 · 1 comment

Comments

@zhangzx-uiuc
Copy link

Hi! Thanks much for developing this tool for model merging!

It seems that the tensor names are hardcoded in https://github.com/arcee-ai/mergekit/tree/main/mergekit/_data/architectures (for Mixtral it is defined in https://github.com/arcee-ai/mergekit/blob/main/mergekit/architecture.py#L282), and a function get_architecture_info (

def get_architecture_info(config: PretrainedConfig) -> ArchitectureInfo:
) is used to look for these parameter names.

Just wondering can we directly read the parameter metadata in "pytorch_model.bin.index.json" or "model.safetensors.index.json"? Otherwise we cannot merged model from our own customized model architecture.

Thanks!

@ElliotStein
Copy link
Contributor

Have a look at the architecture-agnostic branch, this is WIP but should work for you! By the way, it'll work much more efficiently if you have the model stored with safetensors than pytorch bin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants