IB

ibm-granite/granite-7b-instruct

text-generationtransformersapache-2.06.7B params · updated Dec 2024

Usage

usage.pytemplate from repo id
from osai import AutoModelForCausalLM, AutoTokenizer

repo = "ibm-granite/granite-7b-instruct"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(
    repo, dtype="bfloat16", device_map="auto",
)

msgs = [{"role": "user", "content": "Explain speculative decoding."}]
ids = tok.apply_chat_template(msgs, return_tensors="pt").to(model.device)
print(tok.decode(model.generate(ids, max_new_tokens=256)[0]))

Hardware

Computed from 6.74B parameters × bytes per parameter, plus 20% for activations and KV cache. Not measured.

PrecisionWeightsEstimated VRAMFits on
bf1612.6 GB16 GBL4 24 GB
int86.3 GB7.5 GBCPU or T4 16 GB
nf43.1 GB3.8 GBCPU or T4 16 GB