Downloads · 30 days
0
jordimas/bloom-ctranslate2
bloom-ctranslate2 is a machine learning model from jordimas. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as bigscience-bloom-rail-1.0.
This is a collection of some of the Bigscience Bloom exported to CTranslate2 model format. This allows to load and usage these models efficently on CPU or GPU.
Downloads · 30 days
0
Access
Public
Updated Jul 3, 2023
Repo size
68.9 GB
Likes
0
Public
Click a slice to open those files.
.bin61.2 GB · 100%
From the Hugging Face model README
This is a collection of some of the Bigscience Bloom exported to CTranslate2 model format. This allows to load and usage these models efficently on CPU or GPU.
The models have been converted to float16 and can be load in with any other quantification method (e.g. int 8).
| Model name | Description |
|---|---|
| bloom-560m | 560M parameter model pretrained on ROOTS |
| bloom-3b | 3B parameter model pretrained on ROOTS |
| bloomz-7b1 | 7.1B parameter model finetuned on xP3 |
| bloomz-7b1-mt | 7.1B parameter model finetuned on xP3mt |
| mt0-xxl-mt | 13B parameter model finetuned on xP3 |
See directories for the different models available.
Install dependencies:
pip install huggingface_hub ctranslate2 transformers torch
Usage:
import huggingface_hub
import ctranslate2
import transformers
model_name = "bloomz-7b1"
prompt = "Hello, I am Joan and I am from Barcelona and"
repo_id = "jordimas/bloom-ctranslate2"
snapshot_folder = huggingface_hub.snapshot_download(repo_id = repo_id, allow_patterns=f"*{model_name}*")
print(f"folder: {snapshot_folder}")
model = f"{snapshot_folder}/{model_name}"
generator = ctranslate2.Generator(model, compute_type="int8")
tokenizer = transformers.AutoTokenizer.from_pretrained(model)
start_tokens = tokenizer.convert_ids_to_tokens(tokenizer.encode(prompt))
results = generator.generate_batch([start_tokens], max_length=90)
result = tokenizer.decode(results[0].sequences_ids[0])
print(f"Result: {result}")