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