This model is a fine-tuned version of
HuggingFaceTB/SmolLM-135M-Instruct.
It has been trained using
TRL.
This model is an aligned version of HuggingFaceTB/SmolLM-135M-Instruct. Method used for training is PPO.
Final rlhf reward is 1.60, final score is 1.66.
1DEVICE = torch.device("cuda")
2tokenizer = AutoTokenizer.from_pretrained(efromomr/llm-course-hw2-dpo)
3check_model = AutoModelForCausalLM.from_pretrained(efromomr/llm-course-hw2-dpo)
4check_model = check_model.to(DEVICE)
5check_model = check_model.eval()
6
7messages = [{"role": "user", "content": "What's your morning routine like?"}]
8text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
9model_inputs = tokenizer([text], return_tensors="pt")
10
11generated_ids = model.generate(model_inputs.input_ids.to(DEVICE), max_new_tokens=256, do_sample=True)
12response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
13
14print(response)
15#user
16#What's your morning routine like?
17#assistant
18#As I sit here, I'm already feeling a bit...off. I'm trying to get out of bed, but it's hard to get out of bed. I'm trying to get some morning sunlight, but it's just not happening. I'm also feeling a bit...uncomfortable. I'm trying to get some fresh air, but it's just not happening. I'm trying to get some morning exercise, but it's just not happening. I'm trying to get some morning meditation, but it's just not happening.
This model was trained with PPO, a method introduced in
Fine-Tuning Language Models from Human Preferences.
1@article{mziegler2019fine-tuning,
2 title = {{Fine-Tuning Language Models from Human Preferences}},
3 author = {Daniel M. Ziegler and Nisan Stiennon and Jeffrey Wu and Tom B. Brown and Alec Radford and Dario Amodei and Paul F. Christiano and Geoffrey Irving},
4 year = 2019,
5 eprint = {arXiv:1909.08593}
6}
1@misc{vonwerra2022trl,
2 title = {{TRL: Transformer Reinforcement Learning}},
3 author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallouédec},
4 year = 2020,
5 journal = {GitHub repository},
6 publisher = {GitHub},
7 howpublished = {\url{https://github.com/huggingface/trl}}
8}