ReasonFLux-Coder
Collection
Coding LLMs excel at both writing code and generating unit tests. • 9 items • Updated • 11
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Gen-Verse/ReasonFlux-Coder-4B")
model = AutoModelForCausalLM.from_pretrained("Gen-Verse/ReasonFlux-Coder-4B")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
We introduce ReasonFlux-Coders, trained with CURE, our algorithm for co-evolving an LLM's coding and unit test generation abilities.
@article{wang2025cure,
title={Co-Evolving LLM Coder and Unit Tester via Reinforcement Learning},
author={Wang, Yinjie and Yang, Ling and Tian, Ye and Shen, Ke and Wang, Mengdi},
journal={arXiv preprint arXiv:2506.03136},
year={2025}
}
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Gen-Verse/ReasonFlux-Coder-4B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)