Views
No views yet
1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3
4model_id = "kurogane/tinystorys_multiscreen_vocab768"
5cache_dir = r"/media/kurogane/backup/cache"
6
7model = AutoModelForCausalLM.from_pretrained(
8 model_id,
9 trust_remote_code=True,
10 cache_dir=cache_dir,
11 )
12model.to("cuda:0")
13
14tokenizer = AutoTokenizer.from_pretrained(
15 model_id,
16 padding_side="left",
17 cache_dir=cache_dir,
18 )
19
20model_inputs = tokenizer(["A list of colors: red, blue"], return_tensors="pt").to(model.device)
21generated_ids = model.generate(**model_inputs)
22
23s_output = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
24print(s_output)A list of colors: red, blue, yellow, green, orange. All the people
dieOD/multiscreen-pytorch. This model is not an official implementation released by the author of the Multiscreen paper.