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