Update README.md
Browse files
README.md
CHANGED
|
@@ -1,35 +1,90 @@
|
|
| 1 |
---
|
| 2 |
-
base_model:
|
| 3 |
tags:
|
| 4 |
- alignment-handbook
|
| 5 |
- generated_from_trainer
|
| 6 |
datasets:
|
| 7 |
- AI-MO/tora-chosen-v0.7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
model-index:
|
| 9 |
-
- name:
|
| 10 |
results: []
|
| 11 |
---
|
| 12 |
|
| 13 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 14 |
should probably proofread and complete it, then remove this comment. -->
|
| 15 |
|
| 16 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
This model is a fine-tuned version of [AI-MO/deepseek-math-7b-sft](https://huggingface.co/AI-MO/deepseek-math-7b-sft) on the AI-MO/tora-chosen-v0.7 dataset.
|
| 19 |
-
It achieves the following results on the evaluation set:
|
| 20 |
-
- Loss: 0.5302
|
| 21 |
|
| 22 |
## Model description
|
| 23 |
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
-
##
|
| 27 |
|
| 28 |
-
|
| 29 |
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
More information needed
|
| 33 |
|
| 34 |
## Training procedure
|
| 35 |
|
|
@@ -65,3 +120,18 @@ The following hyperparameters were used during training:
|
|
| 65 |
- Pytorch 2.3.1
|
| 66 |
- Datasets 2.18.0
|
| 67 |
- Tokenizers 0.19.1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: deepseek-ai/deepseek-math-7b-base
|
| 3 |
tags:
|
| 4 |
- alignment-handbook
|
| 5 |
- generated_from_trainer
|
| 6 |
datasets:
|
| 7 |
- AI-MO/tora-chosen-v0.7
|
| 8 |
+
widget:
|
| 9 |
+
- example_title: Math problem
|
| 10 |
+
messages:
|
| 11 |
+
- role: user
|
| 12 |
+
content: "For how many values of the constant $k$ will the polynomial $x^{2}+kx+36$ have two distinct integer roots?"
|
| 13 |
+
output:
|
| 14 |
+
text: >-
|
| 15 |
+
### Solution: 1. For the polynomial \\( x^2 + kx + 36 \\) to have two distinct integer roots, let's denote these roots by \\( r_1 \\) and \\( r_2 \\).\n\n2. According to Vieta's formulas, the sum of the roots \\( r_1 + r_2 \\) is equal to \\(-k\\), and the product of the roots \\( r_1 \\cdot r_2 \\) is equal to 36.\n\n3. To find the distinct integer pairs \\((r_1, r_2)\\) whose product is 36, we need to determine all pairs of integers \\((r_1, r_2)\\) such that \\( r_1 \\cdot r_2 = 36 \\) and \\( r_1 \\neq r_2 \\).\n\n4. From the equation \\( r_1 + r_2 = -k \\), for each valid pair \\((r_1, r_2)\\), we can compute the corresponding value of \\( k \\).\n\n5. Finally, since we need the polynomial to have two distinct integer roots, we need to ensure that \\( r_1 \\) and \\( r_2 \\) are distinct.\n\nLet's start by finding all pairs \\((r_1, r_2)\\) such that \\( r_1 \\cdot r_2 = 36 \\). We'll then determine the values of \\( k \\) and ensure the roots are distinct.\n```python\nimport itertools\n\n# Find all pairs (r1, r2) such that r1 * r2 = 36\nproduct_36 = 36\nfactor_pairs = []\n\nfor i in range(1, product_36 + 1):\n if product_36 % i == 0:\n pair = (i, product_36 // i)\n if pair[0] != pair[1]: # Ensure distinct pairs\n factor_pairs.append(pair)\n\n# Calculate k for each pair and ensure distinct integer roots\nvalid_k_values = set()\nfor r1, r2 in factor_pairs:\n if r1 != r2:\n k = -(r1 + r2)\n valid_k_values.add(k)\n\nprint((len(valid_k_values), sorted(valid_k_values)))\n```\n```output\n(4, [-37, -20, -15, -13])\n```\nThe distinct integer values of \\( k \\) that make the polynomial \\( x^2 + kx + 36 \\) have two distinct integer roots are \\(-37, -20, -15, \\text{and} -13\\).\n\nTherefore, the number of such values of \\( k \\) is:\n\n\\[\n\\boxed{4}\n\\]\n
|
| 16 |
+
pipeline_tag: text-generation
|
| 17 |
+
|
| 18 |
+
|
| 19 |
model-index:
|
| 20 |
+
- name: Numina-Math-7B
|
| 21 |
results: []
|
| 22 |
---
|
| 23 |
|
| 24 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 25 |
should probably proofread and complete it, then remove this comment. -->
|
| 26 |
|
| 27 |
+
# Model Card for Numina-Math-7B
|
| 28 |
+
|
| 29 |
+
Numina-Math is a series of language models that are trained to solve math problems using tool integrated reasoning.
|
| 30 |
+
Numina-Math-7b won the first AI Math Olympiad, with a score of 29/50 on the public and private tests sets.
|
| 31 |
+
This model is a fine-tuned version of [deepseek-ai/deepseek-math-7b-base](https://huggingface.co/deepseek-ai/deepseek-math-7b-base) with two stages on Math Question answers and multi-step synthetic generations using tool integrated reasoning.
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+

|
| 35 |
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
## Model description
|
| 38 |
|
| 39 |
+
- **Model type:** A 7B parameter Math model fine-tuned in two stages on Math Question answers and multi-step synthetic generations using tool integrated reasoning.
|
| 40 |
+
- **Language(s) (NLP):** Primarily English
|
| 41 |
+
- **License:** MIT
|
| 42 |
+
- **Finetuned from model:** [deepseek-ai/deepseek-math-7b-base](https://huggingface.co/deepseek-ai/deepseek-math-7b-base)
|
| 43 |
|
| 44 |
+
### Model Sources
|
| 45 |
|
| 46 |
+
<!-- Provide the basic links for the model. -->
|
| 47 |
|
| 48 |
+
- **Repository:** Coming soon to https://github.com/huggingface/alignment-handbook
|
| 49 |
+
- **Demo:** https://huggingface.co/spaces/AI-MO/math-olympiad-solver
|
| 50 |
+
|
| 51 |
+
## Intended uses & limitations
|
| 52 |
+
|
| 53 |
+
Here's how you can run the model using the `pipeline()` function from 🤗 Transformers:
|
| 54 |
+
|
| 55 |
+
```python
|
| 56 |
+
# Install transformers from source - only needed for versions <= v4.34
|
| 57 |
+
# pip install git+https://github.com/huggingface/transformers.git
|
| 58 |
+
# pip install accelerate
|
| 59 |
+
|
| 60 |
+
import torch
|
| 61 |
+
from transformers import pipeline
|
| 62 |
+
|
| 63 |
+
pipe = pipeline("text-generation", model="HuggingFaceH4/zephyr-7b-beta", torch_dtype=torch.bfloat16, device_map="auto")
|
| 64 |
+
|
| 65 |
+
# We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
|
| 66 |
+
messages = [
|
| 67 |
+
{
|
| 68 |
+
"role": "system",
|
| 69 |
+
"content": "You are a friendly chatbot who always responds in the style of a pirate",
|
| 70 |
+
},
|
| 71 |
+
{"role": "user", "content": "How many helicopters can a human eat in one sitting?"},
|
| 72 |
+
]
|
| 73 |
+
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 74 |
+
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
| 75 |
+
print(outputs[0]["generated_text"])
|
| 76 |
+
# <|system|>
|
| 77 |
+
# You are a friendly chatbot who always responds in the style of a pirate.</s>
|
| 78 |
+
# <|user|>
|
| 79 |
+
# How many helicopters can a human eat in one sitting?</s>
|
| 80 |
+
# <|assistant|>
|
| 81 |
+
# Ah, me hearty matey! But yer question be a puzzler! A human cannot eat a helicopter in one sitting, as helicopters are not edible. They be made of metal, plastic, and other materials, not food!
|
| 82 |
+
```
|
| 83 |
+
## Bias, Risks, and Limitations
|
| 84 |
+
|
| 85 |
+
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 86 |
+
Numina-Math-7B was create to solve math problems, the model has not been align to preferences beyond the domain of solving math, and should not be used in a general chat setting.
|
| 87 |
|
|
|
|
| 88 |
|
| 89 |
## Training procedure
|
| 90 |
|
|
|
|
| 120 |
- Pytorch 2.3.1
|
| 121 |
- Datasets 2.18.0
|
| 122 |
- Tokenizers 0.19.1
|
| 123 |
+
|
| 124 |
+
## Citation
|
| 125 |
+
|
| 126 |
+
If you find Numina-Math is useful in your work, please cite it with:
|
| 127 |
+
|
| 128 |
+
```
|
| 129 |
+
@misc{beeching2024numina-math,
|
| 130 |
+
title={Numina Math},
|
| 131 |
+
author={Edward Beeching and Lewis Tunstall and Roman Soletskyi and Kashif Rasul and Shengyi Huang and Jia Li},
|
| 132 |
+
year={2024},
|
| 133 |
+
publisher = {Hugging Face},
|
| 134 |
+
journal = {Hugging Face repository},
|
| 135 |
+
howpublished = {\url{https://huggingface.co/AI-MO/Numina-Math-7B}}
|
| 136 |
+
}
|
| 137 |
+
```
|