Views
No views yet
1from peft import *
2from transformers import *
3peft_path='umarzein/INCITE-WikipediaHeadings'
4base_path="togethercomputer/RedPajama-INCITE-Base-3B-v1"
5base=AutoModelForCausalLM.from_pretrained(base_path)
6tokenizer=AutoTokenizer.from_pretrained(base_path)
7model=PeftModel(base,peft_path)
8output=model.generate(input_ids=tokenizer("Mathematics:",return_tensors='pt')['input_ids'])
9decoded=tokenizer.decode(output.flatten())
10#Mathematics:History|Etymology|Areas of mathematics