If you want to download the group_size 128g file instead, add revision="group_size_128g" to the above command.
Now join the three split files, which can be done with the following Python code:
python
1import glob
23# Get the list of all files matching the pattern4files =sorted(glob.glob('gptq_model-4bit--1g.JOINBEFOREUSE.split-*.safetensors'))56# Open the output file in binary write mode7withopen('gptq_model-4bit--1g.safetensors','wb')as outfile:8for filename in files:9withopen(filename,'rb')as infile:10 outfile.write(infile.read())
Then try the following example code:
python
1from transformers import AutoTokenizer, pipeline, logging
2from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
3import argparse
45# Use the local path you downloaded the model to and joined the split files in6model_name_or_path ="/workspace/models/bloomz-176GB-GPTQ"7model_basename ="gptq_model-4bit--1g"89use_triton =False1011tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)1213model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,14 model_basename=model_basename,15 max_memory={0:'60GiB',1:'79GiB'}# max_memory is for 2 x 80GB GPUs; adjust if your config is different!16 use_safetensors=True,17 trust_remote_code=False,18 use_triton=use_triton,19 quantize_config=None)2021prompt ="Translate this to French: AI is the future of computing"22prompt_template=f'''{prompt}23Translation:
24'''2526print("\n\n*** Generate:")2728input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()29output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)30print(tokenizer.decode(output[0]))3132# Inference can also be done using transformers' pipeline3334# Prevent printing spurious transformers error when using pipeline with AutoGPTQ35logging.set_verbosity(logging.CRITICAL)3637print("*** Pipeline:")38pipe = pipeline(39"text-generation",40 model=model,41 tokenizer=tokenizer,42 max_new_tokens=512,43 temperature=0.7,44 top_p=0.95,45 repetition_penalty=1.1546)4748print(pipe(prompt_template)[0]['generated_text'])
Provided files
Main branch:
gptq_model-4bit--1g.safetensors
This will work with AutoGPTQ. It is untested with GPTQ-for-LLaMa. It will not work with ExLlama.
It was created with group_size none (-1) to reduce VRAM usage, and with --act-order (desc_act) to improve accuracy of responses.
gptq_model-4bit-128g.safetensors
Works with AutoGPTQ in CUDA or Triton modes.
Does NOT work with ExLlama as it's not a Llama model.
Untested with GPTQ-for-LLaMa.
Works with text-generation-webui, including one-click-installers.
Parameters: Groupsize = -1. Act Order / desc_act = True.
Branch group_size_128g
gptq_model-4bit-128g.safetensors
This will work with AutoGPTQ. It is untested with GPTQ-for-LLaMa. It will not work with ExLlama.
It was created with both group_size 128g and --act-order (desc_act) for even higher inference accuracy, at the cost of increased VRAM usage. Because we already need 2 x 80GB or 3 x 48GB GPUs, I don't expect the increased VRAM usage to change the GPU requirements.
Note Using group_size + desc_act together can significantly lower performance in AutoGPTQ CUDA. You might want to try AutoGPTQ Triton mode instead (Linux only.)
gptq_model-4bit-128g.safetensors
Works with AutoGPTQ in CUDA or Triton modes.
Does NOT work with ExLlama as it's not a Llama model.
Untested with GPTQ-for-LLaMa.
Works with text-generation-webui, including one-click-installers.
Parameters: Groupsize = 128. Act Order / desc_act = True.
Discord
For further support, and discussions on these models and AI in general, join us at:
I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
Special thanks to: Luke from CarbonQuill, Aemon Algiz, Dmitriy Samsonov.
Patreon special mentions: zynix , ya boyyy, Trenton Dambrowitz, Imad Khwaja, Alps Aficionado, chris gileta, John Detwiler, Willem Michiel, RoA, Mano Prime, Rainer Wilmers, Fred von Graf, Matthew Berman, Ghost , Nathan LeClaire, Iucharbius , Ai Maven, Illia Dulskyi, Joseph William Delisle, Space Cruiser, Lone Striker, Karl Bernard, Eugene Pentland, Greatston Gnanesh, Jonathan Leane, Randy H, Pierre Kircher, Willian Hasse, Stephen Murray, Alex , terasurfer , Edmond Seymore, Oscar Rangel, Luke Pendergrass, Asp the Wyvern, Junyu Yang, David Flickinger, Luke, Spiking Neurons AB, subjectnull, Pyrater, Nikolai Manek, senxiiz, Ajan Kanaga, Johann-Peter Hartmann, Artur Olbinski, Kevin Schuppel, Derek Yates, Kalila, K, Talal Aujan, Khalefa Al-Ahmad, Gabriel Puliatti, John Villwock, WelcomeToTheClub, Daniel P. Andersen, Preetika Verma, Deep Realms, Fen Risland, trip7s trip, webtim, Sean Connelly, Michael Levine, Chris McCloskey, biorpg, vamX, Viktor Bowallius, Cory Kujawski.
Thank you to all my generous patrons and donaters!
We present BLOOMZ & mT0, a family of models capable of following human instructions in dozens of languages zero-shot. We finetune BLOOM & mT5 pretrained multilingual language models on our crosslingual task mixture (xP3) and find the resulting models capable of crosslingual generalization to unseen tasks & languages.
We recommend using the model to perform tasks expressed in natural language. For example, given the prompt "Translate to English: Je t’aime.", the model will most likely answer "I love you.". Some prompt ideas from our paper:
Suggest at least five related search terms to "Mạng neural nhân tạo".
Write a fairy tale about a troll saving a princess from a dangerous dragon. The fairy tale is a masterpiece that has achieved praise worldwide and its moral is "Heroes Come in All Shapes and Sizes". Story (in Spanish):
Explain in a sentence in Telugu what is backpropagation in neural networks.
Feel free to share your generations in the Community tab!
Prompt Engineering: The performance may vary depending on the prompt. For BLOOMZ models, we recommend making it very clear when the input stops to avoid the model trying to continue it. For example, the prompt "Translate to English: Je t'aime" without the full stop (.) at the end, may result in the model trying to continue the French sentence. Better prompts are e.g. "Translate to English: Je t'aime.", "Translate to English: Je t'aime. Translation:" "What is "Je t'aime." in English?", where it is clear for the model when it should answer. Further, we recommend providing the model as much context as possible. For example, if you want it to answer in Telugu, then tell the model, e.g. "Explain in a sentence in Telugu what is backpropagation in neural networks.".
Training
Model
Architecture: Same as bloom, also refer to the config.json file
We refer to Table 7 from our paper & bigscience/evaluation-results for zero-shot results on unseen tasks. The sidebar reports zero-shot performance of the best prompt per dataset config.
Citation
bibtex
1@article{muennighoff2022crosslingual,
2 title={Crosslingual generalization through multitask finetuning},
3 author={Muennighoff, Niklas and Wang, Thomas and Sutawika, Lintang and Roberts, Adam and Biderman, Stella and Scao, Teven Le and Bari, M Saiful and Shen, Sheng and Yong, Zheng-Xin and Schoelkopf, Hailey and others},
4 journal={arXiv preprint arXiv:2211.01786},
5 year={2022}
6}