Update README.md
Browse files
README.md
CHANGED
|
@@ -169,20 +169,26 @@ response = generate(model, tokenizer, prompt=prompt, max_tokens=400)
|
|
| 169 |
|
| 170 |
Apache 2.0
|
| 171 |
|
|
|
|
|
|
|
| 172 |
------
|
| 173 |
|
| 174 |
-
# Original model Card: palmyra-mini-thinking-a
|
| 175 |
|
| 176 |
-
|
|
|
|
| 177 |
|
| 178 |
-
|
| 179 |
|
| 180 |
-
|
| 181 |
|
| 182 |
-
**
|
|
|
|
|
|
|
|
|
|
|
|
|
| 183 |
|
| 184 |
|
| 185 |
-
## Model
|
| 186 |
|
| 187 |
The palmyra-mini-thinking-a model demonstrates exceptional performance in advanced mathematical reasoning and competitive programming. Its capabilities are highlighted by an outstanding score of 0.886 on the 'MATH500' benchmark, showcasing a robust ability to solve complex mathematical problems. The strength of the model in quantitative challenges is further confirmed by its score of 0.8287 on 'gsm8k (strict-match)', which demonstrates proficiency in multi-step arithmetic reasoning. Additionally, the model proves its aptitude for high-level problem-solving with a score of 0.8 on 'AMC23'. The model also shows strong potential in the coding domain, achieving a score of 0.5631 on 'Codeforces (pass_rate)' and 0.5481 on 'Olympiadbench (extractive_match)', indicating competence in generating correct solutions for programming challenges.
|
| 188 |
|
|
@@ -217,14 +223,88 @@ This section provides a detailed breakdown of the palmyra-mini-thinking-a model'
|
|
| 217 |
| HMMT23 (extractive_match) | 0.1 |
|
| 218 |
| Average | 0.380839 |
|
| 219 |
|
| 220 |
-
## Intended Use
|
| 221 |
|
| 222 |
-
This model is intended for research and development in the field of generative AI, particularly for tasks requiring mathematical and logical reasoning.
|
| 223 |
|
| 224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 225 |
|
| 226 |
-
The model's performance has been evaluated on a specific set of benchmarks. Its performance on other tasks or in real-world applications may vary.
|
| 227 |
|
| 228 |
## Ethical Considerations
|
| 229 |
|
| 230 |
-
As with any language model, there is a potential for generating biased or inaccurate information. Users should be aware of these limitations and use the model responsibly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
|
| 170 |
Apache 2.0
|
| 171 |
|
| 172 |
+
#### Original model card below:
|
| 173 |
+
|
| 174 |
------
|
| 175 |
|
|
|
|
| 176 |
|
| 177 |
+
<div align="center">
|
| 178 |
+
<h1>Palmyra-mini-thinking-a</h1>
|
| 179 |
|
| 180 |
+
</div>
|
| 181 |
|
| 182 |
+
### Model Description
|
| 183 |
|
| 184 |
+
- **Language(s) (NLP):** English
|
| 185 |
+
- **License:** Apache-2.0
|
| 186 |
+
- **Finetuned from model:** Qwen/Qwen2.5-1.5B
|
| 187 |
+
- **Context window:** 131,072 tokens
|
| 188 |
+
- **Parameters:** 1.7 billion
|
| 189 |
|
| 190 |
|
| 191 |
+
## Model Details
|
| 192 |
|
| 193 |
The palmyra-mini-thinking-a model demonstrates exceptional performance in advanced mathematical reasoning and competitive programming. Its capabilities are highlighted by an outstanding score of 0.886 on the 'MATH500' benchmark, showcasing a robust ability to solve complex mathematical problems. The strength of the model in quantitative challenges is further confirmed by its score of 0.8287 on 'gsm8k (strict-match)', which demonstrates proficiency in multi-step arithmetic reasoning. Additionally, the model proves its aptitude for high-level problem-solving with a score of 0.8 on 'AMC23'. The model also shows strong potential in the coding domain, achieving a score of 0.5631 on 'Codeforces (pass_rate)' and 0.5481 on 'Olympiadbench (extractive_match)', indicating competence in generating correct solutions for programming challenges.
|
| 194 |
|
|
|
|
| 223 |
| HMMT23 (extractive_match) | 0.1 |
|
| 224 |
| Average | 0.380839 |
|
| 225 |
|
|
|
|
| 226 |
|
|
|
|
| 227 |
|
| 228 |
+
### Use with transformers
|
| 229 |
+
|
| 230 |
+
You can run conversational inference using the Transformers Auto classes with the `generate()` function. Here's an example:
|
| 231 |
+
|
| 232 |
+
```py
|
| 233 |
+
import torch
|
| 234 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 235 |
+
|
| 236 |
+
model_id = "Writer/palmyra-mini-thinking-a"
|
| 237 |
+
|
| 238 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 239 |
+
|
| 240 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 241 |
+
model_id,
|
| 242 |
+
torch_dtype=torch.float16,
|
| 243 |
+
device_map="auto",
|
| 244 |
+
attn_implementation="flash_attention_2",
|
| 245 |
+
)
|
| 246 |
+
|
| 247 |
+
messages = [
|
| 248 |
+
{
|
| 249 |
+
"role": "user",
|
| 250 |
+
"content": "You have a 3-liter jug and a 5-liter jug. How can you measure exactly 4 liters of water?"
|
| 251 |
+
}
|
| 252 |
+
],
|
| 253 |
+
|
| 254 |
+
input_ids = tokenizer.apply_chat_template(
|
| 255 |
+
messages, tokenize=True, add_generation_prompt=True, return_tensors="pt"
|
| 256 |
+
)
|
| 257 |
+
|
| 258 |
+
gen_conf = {
|
| 259 |
+
"max_new_tokens": 256,
|
| 260 |
+
"eos_token_id": tokenizer.eos_token_id,
|
| 261 |
+
"temperature": 0.3,
|
| 262 |
+
"top_p": 0.9,
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
with torch.inference_mode():
|
| 266 |
+
output_id = model.generate(input_ids, **gen_conf)
|
| 267 |
+
|
| 268 |
+
output_text = tokenizer.decode(output_id[0][input_ids.shape[1] :])
|
| 269 |
+
|
| 270 |
+
print(output_text)
|
| 271 |
+
```
|
| 272 |
+
|
| 273 |
+
## Running with vLLM
|
| 274 |
+
```py
|
| 275 |
+
vllm serve Writer/palmyra-mini-thinking-a
|
| 276 |
+
```
|
| 277 |
+
```py
|
| 278 |
+
curl -X POST http://localhost:8000/v1/chat/completions \
|
| 279 |
+
-H "Content-Type: application/json" \
|
| 280 |
+
-d '{
|
| 281 |
+
"model": "Writer/palmyra-mini-thinking-a",
|
| 282 |
+
"messages": [
|
| 283 |
+
{
|
| 284 |
+
"role": "user",
|
| 285 |
+
"content": "You have a 3-liter jug and a 5-liter jug. How can you measure exactly 4 liters of water?"
|
| 286 |
+
}
|
| 287 |
+
],
|
| 288 |
+
"max_tokens": 8000,
|
| 289 |
+
"temperature": 0.2
|
| 290 |
+
}'
|
| 291 |
+
```
|
| 292 |
|
|
|
|
| 293 |
|
| 294 |
## Ethical Considerations
|
| 295 |
|
| 296 |
+
As with any language model, there is a potential for generating biased or inaccurate information. Users should be aware of these limitations and use the model responsibly.
|
| 297 |
+
|
| 298 |
+
### Citation and Related Information
|
| 299 |
+
|
| 300 |
+
To cite this model:
|
| 301 |
+
```
|
| 302 |
+
@misc{Palmyra-mini-thinking-a,
|
| 303 |
+
author = {Writer Engineering team},
|
| 304 |
+
title = {{Palmyra-mini: A powerful LLM designed for math and coding}},
|
| 305 |
+
howpublished = {\url{https://dev.writer.com}},
|
| 306 |
+
year = 2025,
|
| 307 |
+
month = Sep
|
| 308 |
+
}
|
| 309 |
+
```
|
| 310 |
+
Contact Hello@writer.com
|