miniCTX
Collection
miniCTX: Neural Theorem Proving with (Long-)Contexts (ICLR 2025 Oral) • 8 items • Updated • 2
How to use l3lab/ntp-mathlib-st-deepseek-coder-1.3b with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="l3lab/ntp-mathlib-st-deepseek-coder-1.3b") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("l3lab/ntp-mathlib-st-deepseek-coder-1.3b")
model = AutoModelForCausalLM.from_pretrained("l3lab/ntp-mathlib-st-deepseek-coder-1.3b")How to use l3lab/ntp-mathlib-st-deepseek-coder-1.3b with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "l3lab/ntp-mathlib-st-deepseek-coder-1.3b"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "l3lab/ntp-mathlib-st-deepseek-coder-1.3b",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/l3lab/ntp-mathlib-st-deepseek-coder-1.3b
How to use l3lab/ntp-mathlib-st-deepseek-coder-1.3b with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "l3lab/ntp-mathlib-st-deepseek-coder-1.3b" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "l3lab/ntp-mathlib-st-deepseek-coder-1.3b",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "l3lab/ntp-mathlib-st-deepseek-coder-1.3b" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "l3lab/ntp-mathlib-st-deepseek-coder-1.3b",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use l3lab/ntp-mathlib-st-deepseek-coder-1.3b with Docker Model Runner:
docker model run hf.co/l3lab/ntp-mathlib-st-deepseek-coder-1.3b
State-tactic model from miniCTX: Neural Theorem Proving with (Long-)Contexts.
deepseek-ai/deepseek-coder-1.3b-baseIt is specifically finetuned for Lean 4 tactic prediction given proof states.
Please see our paper.
/- You are proving a theorem in Lean 4.
You are given the following information:
- The current proof state, inside [STATE]...[/STATE]
Your task is to generate the next tactic in the proof.
Put the next tactic inside [TAC]...[/TAC]
-/
[STATE]
m n : â„•
h : Nat.Coprime m n
⊢ Nat.gcd m n = 1
[/STATE]
[TAC]
rw [Nat.Coprime] at h
[/TAC]
Please cite:
@misc{hu2024minictx,
title={miniCTX: Neural Theorem Proving with (Long-)Contexts},
author={Jiewen Hu and Thomas Zhu and Sean Welleck},
year={2024},
eprint={2408.03350},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2408.03350},
}