Views
No views yet
checkpoint-250/checkpoint-500/ (latest, recommended)adapter_model.safetensors)1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4tokenizer = AutoTokenizer.from_pretrained("grpo_gsm8k/checkpoint-500")
5model = AutoModelForCausalLM.from_pretrained(
6 "grpo_gsm8k/checkpoint-500",
7 torch_dtype=torch.float16,
8 device_map="auto"
9)
10
11prompt = "What is the sqrt of 101?"
12inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
13outputs = model.generate(
14 **inputs,
15 max_new_tokens=1024,
16 temperature=0.4,
17 top_p=0.95,
18 repetition_penalty=1.15
19)
20response = tokenizer.decode(outputs[0], skip_special_tokens=True)
21print(response)1@article{zhihong2024deepseekmath,
2 title = {{DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models}},
3 author = {Zhihong Shao and Peiyi Wang and Qihao Zhu and Runxin Xu and Junxiao Song and Mingchuan Zhang and Y. K. Li and Y. Wu and Daya Guo},
4 year = 2024,
5 eprint = {arXiv:2402.03300},
6}
71@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{\'e}dec},
4 year = 2020,
5 journal = {GitHub repository},
6 publisher = {GitHub},
7 howpublished = {\url{https://github.com/huggingface/trl}}
8}