HuggingFaceH4/MATH-500
Viewer • Updated • 500 • 170k • 310
How to use ziadrone/oneplusaries55 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="ziadrone/oneplusaries55")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("ziadrone/oneplusaries55")
model = AutoModelForCausalLM.from_pretrained("ziadrone/oneplusaries55")
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]:]))How to use ziadrone/oneplusaries55 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "ziadrone/oneplusaries55"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "ziadrone/oneplusaries55",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/ziadrone/oneplusaries55
How to use ziadrone/oneplusaries55 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "ziadrone/oneplusaries55" \
--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": "ziadrone/oneplusaries55",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "ziadrone/oneplusaries55" \
--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": "ziadrone/oneplusaries55",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use ziadrone/oneplusaries55 with Docker Model Runner:
docker model run hf.co/ziadrone/oneplusaries55
This model is a fine-tuned version of Qwen/Qwen3-1.7B using Supervised Fine-Tuning (SFT) on the HuggingFaceH4/MATH-500 dataset. It is optimized for mathematical reasoning and problem-solving tasks. The fine-tuning process was performed by EKAGRATA TECH PRIVATE LIMITED.
HuggingFaceH4/MATH-500 (50 samples).<reasoning>...</reasoning><answer>...</answer> structure.To use this model for mathematical reasoning:
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("ziadrone/oneplusaries55")
tokenizer = AutoTokenizer.from_pretrained("ziadrone/oneplusaries55")
SYSTEM_PROMPT = """You are a large language model trained to solve mathematical, logical, physics, and general reasoning problems. You must follow the following steps to solve the problem:
1. Carefully analyze the question and identify the key information.
2. Develop a clear and concise plan to approach the problem.
3. Execute your plan step-by-step, providing detailed explanations and intermediate calculations.
4. Verify your solution to ensure it is accurate and makes sense in the context of the problem.
5. Present your final answer in a clear and concise format.
6. Always enclose the reasoning process within <reasoning>...</reasoning> tags.
7. Always enclose the final answer within <answer>...</answer> tags.
8. Do not use any other tags besides <reasoning> and <answer>.
9. Do not include any extra information outside of the reasoning or answer tags."""
prompt = f"SYSTEM: {SYSTEM_PROMPT}\nUSER: Solve the equation 2x + 3 = 7."
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_length=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
This model has been fine-tuned on mathematical reasoning tasks and should perform well on similar problems involving step-by-step logical reasoning.
This model is released under the Apache 2.0 license.