Instructions to use QuantFactory/bloomz-7b1-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use QuantFactory/bloomz-7b1-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="QuantFactory/bloomz-7b1-GGUF", filename="bloomz-7b1.Q2_K.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use QuantFactory/bloomz-7b1-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf QuantFactory/bloomz-7b1-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf QuantFactory/bloomz-7b1-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf QuantFactory/bloomz-7b1-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf QuantFactory/bloomz-7b1-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf QuantFactory/bloomz-7b1-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf QuantFactory/bloomz-7b1-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf QuantFactory/bloomz-7b1-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf QuantFactory/bloomz-7b1-GGUF:Q4_K_M
Use Docker
docker model run hf.co/QuantFactory/bloomz-7b1-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use QuantFactory/bloomz-7b1-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QuantFactory/bloomz-7b1-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuantFactory/bloomz-7b1-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/QuantFactory/bloomz-7b1-GGUF:Q4_K_M
- Ollama
How to use QuantFactory/bloomz-7b1-GGUF with Ollama:
ollama run hf.co/QuantFactory/bloomz-7b1-GGUF:Q4_K_M
- Unsloth Studio new
How to use QuantFactory/bloomz-7b1-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for QuantFactory/bloomz-7b1-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for QuantFactory/bloomz-7b1-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for QuantFactory/bloomz-7b1-GGUF to start chatting
- Docker Model Runner
How to use QuantFactory/bloomz-7b1-GGUF with Docker Model Runner:
docker model run hf.co/QuantFactory/bloomz-7b1-GGUF:Q4_K_M
- Lemonade
How to use QuantFactory/bloomz-7b1-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull QuantFactory/bloomz-7b1-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.bloomz-7b1-GGUF-Q4_K_M
List all available models
lemonade list
output = llm(
"Once upon a time,",
max_tokens=512,
echo=True
)
print(output)QuantFactory/bloomz-7b1-GGUF
This is quantized version of bigscience/bloomz-7b1 created using llama.cpp
Original Model Card
Table of Contents
Model Summary
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.
- Repository: bigscience-workshop/xmtf
- Paper: Crosslingual Generalization through Multitask Finetuning
- Point of Contact: Niklas Muennighoff
- Languages: Refer to bloom for pretraining & xP3 for finetuning language proportions. It understands both pretraining & finetuning languages.
- BLOOMZ & mT0 Model Family:
| Multitask finetuned on xP3. Recommended for prompting in English. | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Parameters | 300M | 580M | 1.2B | 3.7B | 13B | 560M | 1.1B | 1.7B | 3B | 7.1B | 176B |
| Finetuned Model | mt0-small | mt0-base | mt0-large | mt0-xl | mt0-xxl | bloomz-560m | bloomz-1b1 | bloomz-1b7 | bloomz-3b | bloomz-7b1 | bloomz |
| Multitask finetuned on xP3mt. Recommended for prompting in non-English. | |||||||||||
| Finetuned Model | mt0-xxl-mt | bloomz-7b1-mt | bloomz-mt | ||||||||
| Multitask finetuned on P3. Released for research purposes only. Strictly inferior to above models! | |||||||||||
| Finetuned Model | mt0-xxl-p3 | bloomz-7b1-p3 | bloomz-p3 | ||||||||
| Original pretrained checkpoints. Not recommended. | |||||||||||
| Pretrained Model | mt5-small | mt5-base | mt5-large | mt5-xl | mt5-xxl | bloom-560m | bloom-1b1 | bloom-1b7 | bloom-3b | bloom-7b1 | bloom |
Use
Intended use
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!
How to use
CPU
Click to expand
# pip install -q transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "bigscience/bloomz-7b1"
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForCausalLM.from_pretrained(checkpoint)
inputs = tokenizer.encode("Translate to English: Je t’aime.", return_tensors="pt")
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))
GPU
Click to expand
# pip install -q transformers accelerate
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "bigscience/bloomz-7b1"
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForCausalLM.from_pretrained(checkpoint, torch_dtype="auto", device_map="auto")
inputs = tokenizer.encode("Translate to English: Je t’aime.", return_tensors="pt").to("cuda")
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))
GPU in 8bit
Click to expand
# pip install -q transformers accelerate bitsandbytes
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "bigscience/bloomz-7b1"
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto", load_in_8bit=True)
inputs = tokenizer.encode("Translate to English: Je t’aime.", return_tensors="pt").to("cuda")
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))
Limitations
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-7b1, also refer to the
config.jsonfile - Finetuning steps: 1000
- Finetuning tokens: 4.19 billion
- Finetuning layout: 1x pipeline parallel, 1x tensor parallel, 64x data parallel
- Precision: float16
Hardware
- CPUs: AMD CPUs with 512GB memory per node
- GPUs: 64 A100 80GB GPUs with 8 GPUs per node (8 nodes) using NVLink 4 inter-gpu connects, 4 OmniPath links
- Communication: NCCL-communications network with a fully dedicated subnet
Software
- Orchestration: Megatron-DeepSpeed
- Optimizer & parallelism: DeepSpeed
- Neural networks: PyTorch (pytorch-1.11 w/ CUDA-11.5)
- FP16 if applicable: apex
Evaluation
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
@article{muennighoff2022crosslingual,
title={Crosslingual generalization through multitask finetuning},
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},
journal={arXiv preprint arXiv:2211.01786},
year={2022}
}
- Downloads last month
- 129
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
Dataset used to train QuantFactory/bloomz-7b1-GGUF
Paper for QuantFactory/bloomz-7b1-GGUF
Evaluation results
- Accuracy on Winogrande XL (xl)validation set self-reported55.800
- Accuracy on XWinograd (en)test set self-reported66.020
- Accuracy on XWinograd (fr)test set self-reported57.830
- Accuracy on XWinograd (jp)test set self-reported52.870
- Accuracy on XWinograd (pt)test set self-reported57.790
- Accuracy on XWinograd (ru)test set self-reported54.920
- Accuracy on XWinograd (zh)test set self-reported63.690
- Accuracy on ANLI (r1)validation set self-reported42.100
- Accuracy on ANLI (r2)validation set self-reported39.500
- Accuracy on ANLI (r3)validation set self-reported41.000
- Accuracy on SuperGLUE (cb)validation set self-reported80.360
- Accuracy on SuperGLUE (rte)validation set self-reported84.120
- Accuracy on XNLI (ar)validation set self-reported53.250
- Accuracy on XNLI (bg)validation set self-reported43.610
- Accuracy on XNLI (de)validation set self-reported46.830
- Accuracy on XNLI (el)validation set self-reported41.530

# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="QuantFactory/bloomz-7b1-GGUF", filename="", )