Views
No views yet
python -m pip install trl1from transformers import pipeline
2
3generator = pipeline("text-generation", model="PranavBP525//tmp/tmp44w1s9gw/PranavBP525/phi-2-storygen-rlhf")
4outputs = generator("Hello, my llama is cute")1from transformers import AutoTokenizer
2from trl import AutoModelForCausalLMWithValueHead
3
4tokenizer = AutoTokenizer.from_pretrained("PranavBP525//tmp/tmp44w1s9gw/PranavBP525/phi-2-storygen-rlhf")
5model = AutoModelForCausalLMWithValueHead.from_pretrained("PranavBP525//tmp/tmp44w1s9gw/PranavBP525/phi-2-storygen-rlhf")
6
7inputs = tokenizer("Hello, my llama is cute", return_tensors="pt")
8outputs = model(**inputs, labels=inputs["input_ids"])