Created
December 25, 2023 18:10
-
-
Save younesbelkada/89fd3984a2992fdbb408fa8e3bf44101 to your computer and use it in GitHub Desktop.
push bnb 4 bit models on the hub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install -U bitsandbytes | |
# pip install -U git+https://github.com/huggingface/transformers.git | |
from transformers import AutoModelForCausalLM, AutoTokenizer | |
model_id = "mistralai/Mixtral-8x7B-Instruct-v0.1" | |
path_to_hub = XXX | |
tokenizer = AutoTokenizer.from_pretrained(model_id) | |
model = AutoModelForCausalLM.from_pretrained(model_id, load_in_4bit=True) | |
model.push_to_hub(path_to_hub) | |
tokenizer.push_to_hub(path_to_hub) |
Facing this issue
RuntimeError: Error(s) in loading state_dict for LlamaForCausalLM:
size mismatch for model.layers.0.mlp.gate_proj.weight: copying a param with shape torch.Size([2097152, 1]) from checkpoint, the shape in current model is torch.Size([4096, 1024]).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey Thanks a lot it worked