ME
meta-llama/Llama-3.1-8B-Instruct
text-generationtransformersllama3.18B params · updated Sep 2024
Usage
usage.pytemplate from repo id
from osai import AutoModelForCausalLM, AutoTokenizer
repo = "meta-llama/Llama-3.1-8B-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 8.03B parameters × bytes per parameter, plus 20% for activations and KV cache. Not measured.
| Precision | Weights | Estimated VRAM | Fits on |
|---|---|---|---|
| bf16 | 15.0 GB | 18 GB | L4 24 GB |
| int8 | 7.5 GB | 9.0 GB | CPU or T4 16 GB |
| nf4 | 3.7 GB | 4.5 GB | CPU or T4 16 GB |