Instructions to use GuoxinChen/ReForm-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GuoxinChen/ReForm-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="GuoxinChen/ReForm-8B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("GuoxinChen/ReForm-8B") model = AutoModelForCausalLM.from_pretrained("GuoxinChen/ReForm-8B") 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use GuoxinChen/ReForm-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GuoxinChen/ReForm-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GuoxinChen/ReForm-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/GuoxinChen/ReForm-8B
- SGLang
How to use GuoxinChen/ReForm-8B 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 "GuoxinChen/ReForm-8B" \ --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": "GuoxinChen/ReForm-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "GuoxinChen/ReForm-8B" \ --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": "GuoxinChen/ReForm-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use GuoxinChen/ReForm-8B with Docker Model Runner:
docker model run hf.co/GuoxinChen/ReForm-8B
Update README.md
Browse files
README.md
CHANGED
|
@@ -32,7 +32,7 @@ It introduces **Prospective Bounded Sequence Optimization (PBSO)** — a novel r
|
|
| 32 |
A reinforcement learning algorithm with position-specific rewards for both task accuracy and critique quality, ensuring stable and interpretable optimization.
|
| 33 |
|
| 34 |
- 📈 **State-of-the-art Semantic Consistency**
|
| 35 |
-
ReForm achieves an **average +
|
| 36 |
|
| 37 |
---
|
| 38 |
|
|
@@ -53,11 +53,10 @@ model_name = "GuoxinChen/ReForm-8B" # or "GuoxinChen/ReForm-32B"
|
|
| 53 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 54 |
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto", device_map="auto")
|
| 55 |
|
| 56 |
-
prompt = "Think step by step to translate the mathematical problem in natural language to Lean 4, and verify the consistency.
|
| 57 |
-
Let $a_1, a_2,\\cdots, a_n$ be real constants, $x$ a real variable, and $f(x)=\\cos(a_1+x)+\\frac{1}{2}\\cos(a_2+x)+\\frac{1}{4}\\cos(a_3+x)+\\cdots+\\frac{1}{2^{n-1}}\\cos(a_n+x).$ Given that $f(x_1)=f(x_2)=0,$ prove that $x_2-x_1=m\\pi$ for some integer $m.$"
|
| 58 |
|
| 59 |
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 60 |
-
outputs = model.generate(**inputs, max_new_tokens=
|
| 61 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 62 |
```
|
| 63 |
|
|
|
|
| 32 |
A reinforcement learning algorithm with position-specific rewards for both task accuracy and critique quality, ensuring stable and interpretable optimization.
|
| 33 |
|
| 34 |
- 📈 **State-of-the-art Semantic Consistency**
|
| 35 |
+
ReForm achieves an **average +22.6pp improvement** over the strongest baseline across four formalization benchmarks (miniF2F, ProofNet, Putnam, and AIME 2025).
|
| 36 |
|
| 37 |
---
|
| 38 |
|
|
|
|
| 53 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 54 |
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto", device_map="auto")
|
| 55 |
|
| 56 |
+
prompt = "Think step by step to translate the mathematical problem in natural language to Lean 4, and verify the consistency.\nLet $a_1, a_2,\\cdots, a_n$ be real constants, $x$ a real variable, and $f(x)=\\cos(a_1+x)+\\frac{1}{2}\\cos(a_2+x)+\\frac{1}{4}\\cos(a_3+x)+\\cdots+\\frac{1}{2^{n-1}}\\cos(a_n+x).$ Given that $f(x_1)=f(x_2)=0,$ prove that $x_2-x_1=m\\pi$ for some integer $m.$"
|
|
|
|
| 57 |
|
| 58 |
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 59 |
+
outputs = model.generate(**inputs, max_new_tokens=32768)
|
| 60 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 61 |
```
|
| 62 |
|