01
01-ai/Yi-1.5-9B-Chat
text-generationtransformersapache-2.08.8B params · updated Jun 2024
Usage
usage.pytemplate from repo id
from osai import AutoModelForCausalLM, AutoTokenizer
repo = "01-ai/Yi-1.5-9B-Chat"
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.83B parameters × bytes per parameter, plus 20% for activations and KV cache. Not measured.
| Precision | Weights | Estimated VRAM | Fits on |
|---|---|---|---|
| bf16 | 16.4 GB | 20 GB | L4 24 GB |
| int8 | 8.2 GB | 9.9 GB | CPU or T4 16 GB |
| nf4 | 4.1 GB | 4.9 GB | CPU or T4 16 GB |