Views
No views yet
| Name | Quant method | Size |
|---|---|---|
| starcoder2-15b-fp16.Q2_K.gguf | Q2_K | 5.77GB |
| starcoder2-15b-fp16.IQ3_XS.gguf | IQ3_XS | 6.25GB |
| starcoder2-15b-fp16.IQ3_S.gguf | IQ3_S | 6.52GB |
| starcoder2-15b-fp16.Q3_K_S.gguf | Q3_K_S | 6.51GB |
| starcoder2-15b-fp16.IQ3_M.gguf | IQ3_M | 6.8GB |
| starcoder2-15b-fp16.Q3_K.gguf | Q3_K | 7.49GB |
| starcoder2-15b-fp16.Q3_K_M.gguf | Q3_K_M | 7.49GB |
| starcoder2-15b-fp16.Q3_K_L.gguf | Q3_K_L | 8.35GB |
| starcoder2-15b-fp16.IQ4_XS.gguf | IQ4_XS | 8.12GB |
| starcoder2-15b-fp16.Q4_0.gguf | Q4_0 | 8.44GB |
| starcoder2-15b-fp16.IQ4_NL.gguf | IQ4_NL | 8.55GB |
| starcoder2-15b-fp16.Q4_K_S.gguf | Q4_K_S | 8.53GB |
| starcoder2-15b-fp16.Q4_K.gguf | Q4_K | 9.18GB |
| starcoder2-15b-fp16.Q4_K_M.gguf | Q4_K_M | 9.18GB |
| starcoder2-15b-fp16.Q4_1.gguf | Q4_1 | 9.35GB |
| starcoder2-15b-fp16.Q5_0.gguf | Q5_0 | 10.27GB |
| starcoder2-15b-fp16.Q5_K_S.gguf | Q5_K_S | 10.27GB |
| starcoder2-15b-fp16.Q5_K.gguf | Q5_K | 10.65GB |
| starcoder2-15b-fp16.Q5_K_M.gguf | Q5_K_M | 10.65GB |
| starcoder2-15b-fp16.Q5_1.gguf | Q5_1 | 11.18GB |
| starcoder2-15b-fp16.Q6_K.gguf | Q6_K | 12.2GB |
| starcoder2-15b-fp16.Q8_0.gguf | Q8_0 | 15.8GB |

transformers from source:pip install git+https://github.com/huggingface/transformers.git1# pip install git+https://github.com/huggingface/transformers.git # TODO: merge PR to main
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4checkpoint = "bigcode/starcoder2-15b"
5device = "cuda" # for GPU usage or "cpu" for CPU usage
6
7tokenizer = AutoTokenizer.from_pretrained(checkpoint)
8# for multiple GPUs install accelerate and do `model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto")`
9model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
10
11inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device)
12outputs = model.generate(inputs)
13print(tokenizer.decode(outputs[0]))torch.bfloat161# pip install accelerate
2import torch
3from transformers import AutoTokenizer, AutoModelForCausalLM
4
5checkpoint = "bigcode/starcoder2-15b"
6tokenizer = AutoTokenizer.from_pretrained(checkpoint)
7
8# for fp16 use `torch_dtype=torch.float16` instead
9model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto", torch_dtype=torch.bfloat16)
10
11inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to("cuda")
12outputs = model.generate(inputs)
13print(tokenizer.decode(outputs[0]))1>>> print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
2Memory footprint: 32251.33 MBbitsandbytes1# pip install bitsandbytes accelerate
2from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
3
4# to use 4bit use `load_in_4bit=True` instead
5quantization_config = BitsAndBytesConfig(load_in_8bit=True)
6
7checkpoint = "bigcode/starcoder2-15b"
8tokenizer = AutoTokenizer.from_pretrained(checkpoint)
9model = AutoModelForCausalLM.from_pretrained(checkpoint, quantization_config=quantization_config)
10
11inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to("cuda")
12outputs = model.generate(inputs)
13print(tokenizer.decode(outputs[0]))1>>> print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
2# load_in_8bit
3Memory footprint: 16900.18 MB
4# load_in_4bit
5>>> print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
6Memory footprint: 9224.60 MB1@misc{lozhkov2024starcoder,
2 title={StarCoder 2 and The Stack v2: The Next Generation},
3 author={Anton Lozhkov and Raymond Li and Loubna Ben Allal and Federico Cassano and Joel Lamy-Poirier and Nouamane Tazi and Ao Tang and Dmytro Pykhtar and Jiawei Liu and Yuxiang Wei and Tianyang Liu and Max Tian and Denis Kocetkov and Arthur Zucker and Younes Belkada and Zijian Wang and Qian Liu and Dmitry Abulkhanov and Indraneil Paul and Zhuang Li and Wen-Ding Li and Megan Risdal and Jia Li and Jian Zhu and Terry Yue Zhuo and Evgenii Zheltonozhskii and Nii Osae Osae Dade and Wenhao Yu and Lucas Krauß and Naman Jain and Yixuan Su and Xuanli He and Manan Dey and Edoardo Abati and Yekun Chai and Niklas Muennighoff and Xiangru Tang and Muhtasham Oblokulov and Christopher Akiki and Marc Marone and Chenghao Mou and Mayank Mishra and Alex Gu and Binyuan Hui and Tri Dao and Armel Zebaze and Olivier Dehaene and Nicolas Patry and Canwen Xu and Julian McAuley and Han Hu and Torsten Scholak and Sebastien Paquet and Jennifer Robinson and Carolyn Jane Anderson and Nicolas Chapados and Mostofa Patwary and Nima Tajbakhsh and Yacine Jernite and Carlos Muñoz Ferrandis and Lingming Zhang and Sean Hughes and Thomas Wolf and Arjun Guha and Leandro von Werra and Harm de Vries},
4 year={2024},
5 eprint={2402.19173},
6 archivePrefix={arXiv},
7 primaryClass={cs.SE}
8}