Text Generation
Transformers
Safetensors
llama
alignment-handbook
Generated from Trainer
conversational
text-generation-inference
Instructions to use AI-MO/NuminaMath-7B-TIR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AI-MO/NuminaMath-7B-TIR with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AI-MO/NuminaMath-7B-TIR") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AI-MO/NuminaMath-7B-TIR") model = AutoModelForCausalLM.from_pretrained("AI-MO/NuminaMath-7B-TIR") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use AI-MO/NuminaMath-7B-TIR with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AI-MO/NuminaMath-7B-TIR" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AI-MO/NuminaMath-7B-TIR", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AI-MO/NuminaMath-7B-TIR
- SGLang
How to use AI-MO/NuminaMath-7B-TIR 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 "AI-MO/NuminaMath-7B-TIR" \ --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": "AI-MO/NuminaMath-7B-TIR", "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 "AI-MO/NuminaMath-7B-TIR" \ --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": "AI-MO/NuminaMath-7B-TIR", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AI-MO/NuminaMath-7B-TIR with Docker Model Runner:
docker model run hf.co/AI-MO/NuminaMath-7B-TIR
Update README.md
#6
by lewtun HF Staff - opened
README.md
CHANGED
|
@@ -1,46 +1,86 @@
|
|
| 1 |
---
|
| 2 |
base_model: deepseek-ai/deepseek-math-7b-base
|
| 3 |
-
license: apache-2.0
|
| 4 |
-
pipeline_tag: text-generation
|
| 5 |
tags:
|
| 6 |
- alignment-handbook
|
| 7 |
- generated_from_trainer
|
| 8 |
widget:
|
| 9 |
-
- example_title: Math problem
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
model-index:
|
| 42 |
- name: NuminaMath-7B-TIR
|
| 43 |
results: []
|
|
|
|
| 44 |
---
|
| 45 |
|
| 46 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
|
|
| 1 |
---
|
| 2 |
base_model: deepseek-ai/deepseek-math-7b-base
|
|
|
|
|
|
|
| 3 |
tags:
|
| 4 |
- alignment-handbook
|
| 5 |
- generated_from_trainer
|
| 6 |
widget:
|
| 7 |
+
- example_title: Math problem
|
| 8 |
+
messages:
|
| 9 |
+
- role: user
|
| 10 |
+
content: >-
|
| 11 |
+
For how many values of the constant $k$ will the polynomial
|
| 12 |
+
$x^{2}+kx+36$ have two distinct integer roots?
|
| 13 |
+
output:
|
| 14 |
+
text: >-
|
| 15 |
+
### Solution:
|
| 16 |
+
|
| 17 |
+
1- For the polynomial \\( x^2 + kx + 36 \\) to have two
|
| 18 |
+
distinct integer roots, let's denote these roots by \\( r_1 \\) and \\(
|
| 19 |
+
r_2 \\).
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
2- According to Vieta's formulas, the sum of the roots \\( r_1 + r_2 \\)
|
| 24 |
+
is equal to \\(-k\\), and the product of the roots \\( r_1 \\cdot r_2
|
| 25 |
+
\\) is equal to 36.
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
3- To find the distinct integer pairs \\((r_1, r_2)\\) whose product is
|
| 30 |
+
36, we need to determine all pairs of integers \\((r_1, r_2)\\) such
|
| 31 |
+
that \\( r_1 \\cdot r_2 = 36 \\) and \\( r_1 \\neq r_2 \\).
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
4- From the equation \\( r_1 + r_2 = -k \\), for each valid pair
|
| 36 |
+
\\((r_1, r_2)\\), we can compute the corresponding value of \\( k \\).
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
5- Finally, since we need the polynomial to have two distinct integer
|
| 41 |
+
roots, we need to ensure that \\( r_1 \\) and \\( r_2 \\) are distinct.
|
| 42 |
+
|
| 43 |
+
Let's start by finding all pairs \\((r_1, r_2)\\) such that \\( r_1
|
| 44 |
+
\\cdot r_2 = 36 \\). We'll then determine the values of \\( k \\) and
|
| 45 |
+
ensure the roots are distinct.
|
| 46 |
+
|
| 47 |
+
```python import itertools
|
| 48 |
+
|
| 49 |
+
# Find all pairs (r1, r2) such that r1 * r2 = 36 product_36 = 36
|
| 50 |
+
factor_pairs = []
|
| 51 |
+
|
| 52 |
+
for i in range(1, product_36 + 1):
|
| 53 |
+
if product_36 % i == 0:
|
| 54 |
+
pair = (i, product_36 // i)
|
| 55 |
+
if pair[0] != pair[1]: # Ensure distinct pairs
|
| 56 |
+
factor_pairs.append(pair)
|
| 57 |
+
|
| 58 |
+
# Calculate k for each pair and ensure distinct integer roots
|
| 59 |
+
valid_k_values = set()
|
| 60 |
+
for r1, r2 in factor_pairs:
|
| 61 |
+
if r1 != r2:
|
| 62 |
+
k = -(r1 + r2)
|
| 63 |
+
valid_k_values.add(k)
|
| 64 |
+
|
| 65 |
+
print((len(valid_k_values), sorted(valid_k_values)))
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
```output
|
| 69 |
+
(4, [-37, -20, -15,-13])
|
| 70 |
+
```
|
| 71 |
+
The distinct integer values of \\( k \\) that make the
|
| 72 |
+
polynomial \\( x^2 + kx + 36 \\) have two distinct integer roots are
|
| 73 |
+
\\(-37, -20, -15, \\text{and} -13\\).
|
| 74 |
+
|
| 75 |
+
Therefore, the number of such values of \\( k \\) is:
|
| 76 |
+
|
| 77 |
+
[ \\boxed{4} \\]
|
| 78 |
+
|
| 79 |
+
pipeline_tag: text-generation
|
| 80 |
model-index:
|
| 81 |
- name: NuminaMath-7B-TIR
|
| 82 |
results: []
|
| 83 |
+
license: apache-2.0
|
| 84 |
---
|
| 85 |
|
| 86 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|