Instructions to use Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO") model = AutoModelForCausalLM.from_pretrained("Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO
- SGLang
How to use Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO", max_seq_length=2048, ) - Docker Model Runner
How to use Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO with Docker Model Runner:
docker model run hf.co/Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO")
model = AutoModelForCausalLM.from_pretrained("Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO")
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]:]))
LLaMA-3-8B-Math-Majority-Vote-GRPO
Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO is a Test Time Reinforcement Learning (TTRL) trained version of ytu-ce-cosmos/Turkish-Llama-8b-DPO-v0.1. It is trained on Turkish math word problems using GRPO method and a majority vote reward function.
Paper: TTRL: Test-Time Reinforcement Learning Code: https://github.com/PRIME-RL/TTRL
Training Info
Base Model: Turkish-Llama-8b-DPO-v0.1
Training Data: 2.000 open-ended math word problems. No proprietary data was included.
Training Time: 13 hours on a single L40S
LoRA Configs:
- lora_r: 16
- lora_alpha: 16
- lora_dropout: 0
- lora_target_linear: true
The goal was to train a model without using any labels or ground truth answers that can reason before generating the answer. It uses the below template:
<mantık>
...
</mantık>
<cevap>
</cevap>
For more information visit my blog post about this model please.
How to use
- Install vLLM
pip install vllm
2.
from vllm import LLM, SamplingParams
import json
llm = LLM(model="Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO")
sampling_params = SamplingParams(temperature=0.5)
SYSTEM_PROMPT = """
Sana verilen matematik problemi hakkında düşün ve çözümü bul.
Düşüncelerini <mantık> ve </mantık> arasına yaz.
Sonucu ise <cevap> ve </cevap> arasına yaz. Sonucu yazarken sadece rakamları, noktayı ve virgülü kullan. Noktayı binlik ayracı, virgülü ise ondalık ayracı olarak kullanmalısın. Örnek: <cevap>1.450,02</cevap>
"""
conversation = [
{
"role": "system",
"content": SYSTEM_PROMPT
}
{
"role": "user",
"content": "Nüfus 20.000'dir. Nüfus her yıl %10 artmaktadır. Buna göre üç yıl sonra nüfus kaç olur?"
}
]
outputs = llm.chat(
conversation,
sampling_params=sampling_params,
use_tqdm=False
)
result = json.loads(outputs[0].outputs[0].text)
print(result)
Citation
@article{zuo2025ttrl,
title={Ttrl: Test-time reinforcement learning},
author={Zuo, Yuxin and Zhang, Kaiyan and Qu, Shang and Sheng, Li and Zhu, Xuekai and Qi, Biqing and Sun, Youbang and Cui, Ganqu and Ding, Ning and Zhou, Bowen},
journal={arXiv preprint arXiv:2504.16084},
year={2025}
}
- Downloads last month
- 8
Model tree for Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO
Base model
meta-llama/Meta-Llama-3-8B
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Metin/LLaMA-3-8B-Math-Majority-Vote-GRPO") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)