We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I tried:
from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig import torch # model_id = "huggyllama/llama-7B" model_id = "mistralai/Mistral-7B-Instruct-v0.1" # model_id = "meta-llama/Llama-2-7b-chat-hf" tokenizer = AutoTokenizer.from_pretrained(model_id) with torch.device("cuda"): model = AutoModelForCausalLM.from_pretrained(model_id) model = model.eval() inp = tokenizer("Summer is hot, winter is ", return_tensors="pt").to("cuda") gen_config = GenerationConfig( max_new_tokens=100, min_new_tokens=100, use_cache=True, num_beams=1, do_sample=False, ) with torch.no_grad(): # model.model.layers[1].mlp.down_proj.weight[2533, 7890] = 0 # llama 2 7B model.model.layers[1].mlp.down_proj.weight[2070, 7310] = 0 # mistral 7B v0.1 # model.model.layers[2].mlp.down_proj.weight[3968, 7003] = 0 # llama 1 7B res = model.generate(**inp, generation_config=gen_config) print(tokenizer.batch_decode(res))
without qualitative deterioration of the output for mistralai/Mistral-7B-Instruct-v0.1 & meta-llama/Llama-2-7b-chat-hf.
mistralai/Mistral-7B-Instruct-v0.1
meta-llama/Llama-2-7b-chat-hf
I did reproduce the paper claim with huggyllama/llama-7B and with mistralai/Mistral-7B-v0.1 (I did not try meta-llama/Llama-2-7b).
huggyllama/llama-7B
mistralai/Mistral-7B-v0.1
meta-llama/Llama-2-7b
Do you have some reference code / model to reproduce with?
Thank you!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I tried:
without qualitative deterioration of the output for
mistralai/Mistral-7B-Instruct-v0.1
&meta-llama/Llama-2-7b-chat-hf
.I did reproduce the paper claim with
huggyllama/llama-7B
and withmistralai/Mistral-7B-v0.1
(I did not trymeta-llama/Llama-2-7b
).Do you have some reference code / model to reproduce with?
Thank you!
The text was updated successfully, but these errors were encountered: