Views
No views yet
1pip install torch
2git clone https://github.com/IST-DASLab/marlin.git
3cd marlin
4pip install -e .sym=truegroup_size=128desc_activations=falsepip install -U transformers accelerate auto-gptq optimumconvert.py script in this repo:python3 convert.py --model-id "TheBloke/Llama-2-7B-Chat-GPTQ" --save-path "./marlin-model" --do-generationload.load_model utility from this repo and run inference as usual.1from load import load_model
2from transformers import AutoTokenizer
3# Load model from disk.
4model_path = "./marlin-model"
5model = load_model(model_path).to("cuda")
6tokenizer = AutoTokenizer.from_pretrained(model_path)
7# Generate text.
8inputs = tokenizer("My favorite song is", return_tensors="pt")
9inputs = {k: v.to("cuda") for k, v in inputs.items()}
10outputs = model.generate(**inputs, max_new_tokens=50, do_sample=False)
11print(tokenizer.batch_decode(outputs)[0])