Views
No views yet
bfloat16 so in theory you can run this on CPU, though it may take forever.
Original code and credits go to mpt-7b-storywriter-sharded.
See the community discussion on how to replicate this.Note when using: this is not an instruction-tuned model, so you need to give it sufficient input text to continue generating something on-topic with your prompt
pip install -U torch transformers accelerate einops1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model_name = 'jprafael/mpt-7b-instruct-sharded'
5model = AutoModelForCausalLM.from_pretrained(
6 model_name,
7 torch_dtype=torch.bfloat16,
8 trust_remote_code=True,
9 revision='8d8911ad980f48f8a791e5f5876dea891dcbc064', # optional, but a good idea
10 device_map='auto',
11 load_in_8bit=False, # install bitsandbytes then set to true for 8-bit
12)
13model = torch.compile(model)
14tokenizer = AutoTokenizer.from_pretrained(model_name)model.generate() as you would normally - see the notebook for details.