Run this model with HF Jobs
Run EugeneEvstafev/cevra-math-decisions-v2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/EugeneEvstafev/cevra-math-decisions-v2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/EugeneEvstafev/cevra-math-decisions-v2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/EugeneEvstafev/cevra-math-decisions-v2. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/EugeneEvstafev/cevra-math-decisions-v2. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use EugeneEvstafev/cevra-math-decisions-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EugeneEvstafev/cevra-math-decisions-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="EugeneEvstafev/cevra-math-decisions-v2") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("EugeneEvstafev/cevra-math-decisions-v2") model = AutoModelForMultimodalLM.from_pretrained("EugeneEvstafev/cevra-math-decisions-v2", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use EugeneEvstafev/cevra-math-decisions-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EugeneEvstafev/cevra-math-decisions-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EugeneEvstafev/cevra-math-decisions-v2", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/EugeneEvstafev/cevra-math-decisions-v2
- SGLang
How to use EugeneEvstafev/cevra-math-decisions-v2 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 "EugeneEvstafev/cevra-math-decisions-v2" \ --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": "EugeneEvstafev/cevra-math-decisions-v2", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "EugeneEvstafev/cevra-math-decisions-v2" \ --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": "EugeneEvstafev/cevra-math-decisions-v2", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use EugeneEvstafev/cevra-math-decisions-v2 with Docker Model Runner:
docker model run hf.co/EugeneEvstafev/cevra-math-decisions-v2
Cevra Math Decisions v2
A full merged model based on Qwen/Qwen3.5-4B, fine-tuned to score subject categories for mathematical problems.
Training
The model was trained in Tinker Decision Model mode using a LoRA adapter and a soft-label objective. It used 3,622 training examples, 458 validation examples, and 458 held-out test examples from the same private prepared snapshot as the earlier Cevra GPT-OSS-20B run (snapshot revision 459, grouped splits with seed 42). The data are synthetic variants derived from MATH-500; the underlying dataset remains private.
Training completed 227 steps in one epoch, with LoRA rank 16, batch size 16, learning rate 0.0001, and maximum sequence length 2,048. The final step was selected using validation. The provider did not disclose the base revision used during training. The independently pinned Hugging Face base revision used for merging is 851bf6e806efd8d0a36b00ddf55e13ccb7b8cd0a; the comparisons below show approximate agreement rather than identical weights.
Evaluation
The Tinker sampler, evaluated on all 458 held-out test examples, achieved 69.4323% argmax agreement, 0.058251 distribution Brier, and 0.041392 probability MAE against the prepared target distributions. These are agreement metrics, not independently established accuracy or calibration. Validation was used to select the checkpoint; the held-out examples were not used for checkpoint selection. Both splits are derived from MATH-500 and do not constitute an independent MATH-500 benchmark.
The local merged model and the pinned Hugging Face base were evaluated on those same 458 held-out examples:
| Metric | HF base | Merged model |
|---|---|---|
| Argmax agreement (higher is better) | 57.6419% | 69.8690% |
| Distribution Brier (lower is better) | 0.169736 | 0.059772 |
| Probability MAE (lower is better) | 0.076854 | 0.042011 |
For the first 10 test examples, the merged model's argmax matched the Tinker trained sampler on 10/10; the maximum absolute probability difference was 0.0540073. On 10 independently invented synthetic probes, the Hugging Face base and Tinker base argmax matched on 9/10, with maximum absolute probability difference 0.0491300. These are small diagnostic samples, and the observed disagreement means the base models must not be assumed identical.
The original GPU evaluation failed its pre-specified 0.05 trained-model difference threshold. The user subsequently accepted a 0.1 threshold for both comparisons; the saved GPU predictions were reassessed locally under that post-hoc threshold without rerunning the GPU. The original failure was retained. The threshold change and small reference sample limit the strength of the equivalence evidence.
Decision-token scoring example
The following example uses an invented question, not a dataset example. Its scoring procedure was used in the 458-example evaluation; this particular example has not been executed separately. The evaluation environment used Python 3.12, PyTorch 2.15.0, Transformers 5.22.2, Accelerate 1.15.0 and Tinker Cookbook 0.6.1 with a CUDA GPU. Set model_path to a local merged-model directory or this published repository.
import json
import math
import torch
from tinker_cookbook import renderers
from tinker_cookbook.recipes.decisions import Decision, DecisionRenderer
from transformers import AutoModelForImageTextToText, AutoTokenizer
model_path = "EugeneEvstafev/cevra-math-decisions-v2"
device = "cuda:0"
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=False)
model = AutoModelForImageTextToText.from_pretrained(
model_path,
dtype=torch.bfloat16,
device_map={"": device},
trust_remote_code=False,
).eval()
renderer = DecisionRenderer(renderers.get_renderer("qwen3_5", tokenizer))
example = {
"state": "A rectangle has sides 3 cm and 7 cm. What is its area?",
"question": {
"type": "choice",
"instructions": "Which subject best describes the problem?",
"criteria": {
"Algebra": "Equations, expressions, and variables",
"Geometry": "Shapes, distances, areas, and angles",
"Number Theory": "Properties of integers",
},
},
}
question = example["question"]
text = json.dumps(
{"state": example["state"], "instructions": question["instructions"]},
ensure_ascii=False,
sort_keys=True,
)
choices = [(str(k), str(v)) for k, v in question["criteria"].items()]
rendered = renderer.render(Decision(text, choices))
if rendered.choice_pos != len(rendered.tokens) - 1 or rendered.choice_pos < 1:
raise ValueError("Unexpected decision token positions")
prompt = torch.tensor([rendered.tokens[:rendered.choice_pos]], dtype=torch.long, device=device)
with torch.inference_mode():
logits = model(input_ids=prompt, use_cache=False).logits[0, -1].float()
labels = rendered.labels
ids = torch.tensor([rendered.label_tokens[k] for k in labels], dtype=torch.long, device=device)
probabilities = torch.softmax(logits[ids], dim=0).cpu().tolist()
if not all(math.isfinite(p) and 0 <= p <= 1 for p in probabilities) or abs(sum(probabilities) - 1) > 1e-5:
raise ValueError("Invalid probability distribution")
print(dict(zip(labels, probabilities, strict=True)))
This computes probabilities by selecting the decision labels' next-token logits and normalizing them across the offered labels. Generating JSON from the model is not equivalent. The model was trained on choice examples; no performance claim is made for other decision types.
Limitations
The training targets are synthetic or adjusted distributions, and the scores are not known to be calibrated probabilities. Generated variants can contain mathematical errors. The MATH-500 source card does not state a license; applicable rights for distribution of derivatives require verification.
- Downloads last month
- 66