Views
No views yet
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained("npvinHnivqn/phi-1_5-NRL", trust_remote_code=True)
4tokenizer = AutoTokenizer.from_pretrained("npvinHnivqn/phi-1_5-NRL", trust_remote_code=True)
5
6inputs = tokenizer('''<|USER|> Write a paragragh about animal''', return_tensors="pt", return_attention_mask=False)
7
8outputs = model.generate(**inputs, max_length=200)
9text = tokenizer.batch_decode(outputs)[0]
10print(text)