Views
No views yet
1from awq import AutoAWQForCausalLM
2from transformers import AutoTokenizer
3model_name = "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B"
4commit_hash = "393119fcd6a873e5776c79b0db01c96911f5f0fc"
5# Download the model and tokenizer at the specific commit hash
6model = AutoAWQForCausalLM.from_pretrained(model_name, revision=commit_hash)
7tokenizer = AutoTokenizer.from_pretrained(model_name, revision=commit_hash)
8quant_config = { "zero_point": True, "q_group_size": 128, "w_bit": 4, "version": "GEMV" }
9model.quantize(tokenizer, quant_config=quant_config)