How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="gair-prox/math-doc-refining-lm")
messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe(messages)
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("gair-prox/math-doc-refining-lm")
model = AutoModelForCausalLM.from_pretrained("gair-prox/math-doc-refining-lm")
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]:]))
Quick Links

Math-doc-refining-lm

ArXiv | Code

Math-doc-refining-lm is an adapted 0.7B-ProX model, fine-tuned for doc level refining via program generation, and can be applied over math pre-training corpus such as open-web-math.

Citation

@article{zhou2024programming,
  title={Programming Every Example: Lifting Pre-training Data Quality like Experts at Scale},
  author={Zhou, Fan and Wang, Zengzhi and Liu, Qian and Li, Junlong and Liu, Pengfei},
  journal={arXiv preprint arXiv:2409.17115},
  year={2024}
}
Downloads last month
4
Safetensors
Model size
0.8B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for gair-prox/math-doc-refining-lm

Finetuned
(1)
this model

Dataset used to train gair-prox/math-doc-refining-lm

Collection including gair-prox/math-doc-refining-lm

Paper for gair-prox/math-doc-refining-lm