Improve model card: Add metadata, prominent links, and sample usage
#1
by
nielsr
HF Staff
- opened
README.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
## Introduction
|
| 2 |
We release our first reflective generative model: MetaStone-S1.
|
| 3 |
With only 32B parameters, MetaStone-S1 performs comparably to the OpenAI-o3 series on mathematics, coding, and Chinese reasoning tasks.
|
|
@@ -11,6 +21,42 @@ By sharing the backbone network between the PRMs and policy models, MetaStone‑
|
|
| 11 |
|
| 12 |
This repo contains the training and evaluation code of MetaStone-S1. For full details please refer to our [paper](https://arxiv.org/abs/2507.01951) and [our official website](https://www.wenxiaobai.com/).
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
## Performance
|
| 16 |
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pipeline_tag: text-generation
|
| 3 |
+
library_name: transformers
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
# [Test-Time Scaling with Reflective Generative Model](https://huggingface.co/papers/2507.01951)
|
| 7 |
+
|
| 8 |
+
**Project page:** [https://www.wenxiaobai.com/](https://www.wenxiaobai.com/)
|
| 9 |
+
**Code:** [https://github.com/MetaStone-AI/MetaStone-S1](https://github.com/MetaStone-AI/MetaStone-S1)
|
| 10 |
+
|
| 11 |
## Introduction
|
| 12 |
We release our first reflective generative model: MetaStone-S1.
|
| 13 |
With only 32B parameters, MetaStone-S1 performs comparably to the OpenAI-o3 series on mathematics, coding, and Chinese reasoning tasks.
|
|
|
|
| 21 |
|
| 22 |
This repo contains the training and evaluation code of MetaStone-S1. For full details please refer to our [paper](https://arxiv.org/abs/2507.01951) and [our official website](https://www.wenxiaobai.com/).
|
| 23 |
|
| 24 |
+
## Sample Usage
|
| 25 |
+
|
| 26 |
+
You can easily use MetaStone-S1 for text generation with the `transformers` library by setting `trust_remote_code=True`.
|
| 27 |
+
For full details on using the reflective generative model with its advanced features (SPRM inference, training, etc.), please refer to the [official GitHub repository](https://github.com/MetaStone-AI/MetaStone-S1).
|
| 28 |
+
|
| 29 |
+
```python
|
| 30 |
+
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
|
| 31 |
+
import torch
|
| 32 |
+
|
| 33 |
+
model_name = "MetaStoneTec/MetaStone-S1-1.5B" # Or MetaStoneTec/MetaStone-S1-7B, MetaStoneTec/MetaStone-S1-32B
|
| 34 |
+
pipe = pipeline(
|
| 35 |
+
"text-generation",
|
| 36 |
+
model=model_name,
|
| 37 |
+
tokenizer=AutoTokenizer.from_pretrained(model_name, trust_remote_code=True),
|
| 38 |
+
torch_dtype=torch.bfloat16, # or torch.float16 depending on your hardware
|
| 39 |
+
device_map="auto",
|
| 40 |
+
trust_remote_code=True, # Required for models with custom architectures like Qwen2
|
| 41 |
+
)
|
| 42 |
+
|
| 43 |
+
# Example: Text Generation
|
| 44 |
+
input_text = "The key to life is"
|
| 45 |
+
generated_text = pipe(input_text, max_new_tokens=20, do_sample=True)[0]["generated_text"]
|
| 46 |
+
print(f"Input: {input_text}
|
| 47 |
+
Output: {generated_text}")
|
| 48 |
+
|
| 49 |
+
# Example: Using chat template for conversational models
|
| 50 |
+
# Note: Ensure the tokenizer for the specific model has a chat template configured.
|
| 51 |
+
# You might need to load the model and tokenizer separately for chat templates.
|
| 52 |
+
# tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
| 53 |
+
# model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True)
|
| 54 |
+
# messages = [{"role": "user", "content": "Hi! How are you?"}]
|
| 55 |
+
# text = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
|
| 56 |
+
# inputs = tokenizer(text, return_tensors="pt").to(model.device)
|
| 57 |
+
# outputs = model.generate(inputs.input_ids, max_new_tokens=30)
|
| 58 |
+
# print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 59 |
+
```
|
| 60 |
|
| 61 |
## Performance
|
| 62 |
|