from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# Replace with your model path
model_path = "TIGER-Lab/general-verifier"# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype=torch.float16).cuda()
# Example inputs
question = "Factor the following quadratic: $3 x^3+\frac{69 x^2}{2}-36 x-810$"
ground_truth = "\\frac{3(2x-9)(x+6)(x+10)}{2}"
student_answer = "\\frac{3}{2}(x+6)(2x-9)(x+10)"# Create prompt
prompt = (
f"User: ### Question: {question}\n\n"f"### Ground Truth Answer: {ground_truth}\n\n"f"### Student Answer: {student_answer}\n\n""For the above question, please verify if the student's answer is equivalent to the ground truth answer.\n""Do not solve the question by yourself; just check if the student's answer is equivalent to the ground truth answer.\n""If the student's answer is correct, output \"Final Decision: Yes\". If the student's answer is incorrect, output \"Final Decision: No\". Assistant:"
)
# Tokenize and generate
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=1024,
temperature=0.0,
do_sample=False
)
# Decode and print outputprint(tokenizer.decode(outputs[0], skip_special_tokens=True))
Runs of TIGER-Lab general-verifier on huggingface.co
10.6K
Total runs
0
24-hour runs
-1.3K
3-day runs
-3.6K
7-day runs
-3.6K
30-day runs
More Information About general-verifier huggingface.co Model
general-verifier huggingface.co is an AI model on huggingface.co that provides general-verifier's model effect (), which can be used instantly with this TIGER-Lab general-verifier model. huggingface.co supports a free trial of the general-verifier model, and also provides paid use of the general-verifier. Support call general-verifier model through api, including Node.js, Python, http.
general-verifier huggingface.co is an online trial and call api platform, which integrates general-verifier's modeling effects, including api services, and provides a free online trial of general-verifier, you can try general-verifier online for free by clicking the link below.
TIGER-Lab general-verifier online free url in huggingface.co:
general-verifier is an open source model from GitHub that offers a free installation service, and any user can find general-verifier on GitHub to install. At the same time, huggingface.co provides the effect of general-verifier install, users can directly use general-verifier installed effect in huggingface.co for debugging and trial. It also supports api for free installation.