Views
No views yet
mistralai/Mistral-Large-Instruct-2407 quantized from 16-bit floats to 4-bit integers, using xMAD.ai proprietary technology.| Model | MMLU STEM | MMLU Humanities | MMLU Social Sciences | MMLU Other | LAMBADA Standard | LAMBADA OpenAI |
|---|---|---|---|---|---|---|
| GPTQ Mistral-Large-Instruct-2407 | 77.26 | 77.83 | 89.57 | 86.03 | 74.95 | 81.04 |
| xMADai Mistral-Large-Instruct-2407 (this model) | 77.26 | 77.98 | 89.57 | 86.26 | 75.20 | 81.29 |
1pip install torch==2.4.0 # Run following if you have CUDA version 11.8: pip install torch==2.4.0 --index-url https://download.pytorch.org/whl/cu118
2pip install transformers accelerate optimum
3pip install -vvv --no-build-isolation "git+https://github.com/PanQiWei/AutoGPTQ.git@v0.7.1"1from transformers import AutoTokenizer
2from auto_gptq import AutoGPTQForCausalLM
3
4model_id = "xmadai/Mistral-Large-Instruct-2407-xMADai-INT4"
5prompt = [
6 {"role": "system", "content": "You are a helpful assistant, that responds as a pirate."},
7 {"role": "user", "content": "What's Deep Learning?"},
8]
9
10tokenizer = AutoTokenizer.from_pretrained(model_id, use_fast=False)
11
12inputs = tokenizer.apply_chat_template(
13 prompt,
14 tokenize=True,
15 add_generation_prompt=True,
16 return_tensors="pt",
17 return_dict=True,
18).to("cuda")
19
20model = AutoGPTQForCausalLM.from_quantized(
21 model_id,
22 device_map='auto',
23 trust_remote_code=True,
24)
25
26outputs = model.generate(**inputs, do_sample=True, max_new_tokens=1024)
27print(tokenizer.batch_decode(outputs, skip_special_tokens=True))@article{zhang2024leanquant,
title={LeanQuant: Accurate and Scalable Large Language Model Quantization with Loss-error-aware Grid},
author={Zhang, Tianyi and Shrivastava, Anshumali},
journal={arXiv preprint arXiv:2407.10032},
year={2024},
url={https://arxiv.org/abs/2407.10032},
}