RuleReasoner/RuleCollection-32K
Viewer • Updated • 32.3k • 261 • 4
How to use RuleReasoner/RuleReasoner-8B with Transformers:
# Use a pipeline as a high-level helper
# Warning: Pipeline type "question-answering" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# pip install "transformers<5.0.0"
from transformers import pipeline
pipe = pipeline("question-answering", model="RuleReasoner/RuleReasoner-8B") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("RuleReasoner/RuleReasoner-8B")
model = AutoModelForCausalLM.from_pretrained("RuleReasoner/RuleReasoner-8B", device_map="auto")# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("RuleReasoner/RuleReasoner-8B")
model = AutoModelForCausalLM.from_pretrained("RuleReasoner/RuleReasoner-8B", device_map="auto")If you use the model in your research, please cite the original papers as below.
@article{liu2025rulereasoner,
title={RuleReasoner: Reinforced Rule-based Reasoning via Domain-aware Dynamic Sampling},
author={Yang Liu and Jiaqi Li and Zilong Zheng},
year={2025},
eprint={2506.08672},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2506.08672},
}
# Use a pipeline as a high-level helper # Warning: Pipeline type "question-answering" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("question-answering", model="RuleReasoner/RuleReasoner-8B")