Update README.md
Browse files
README.md
CHANGED
@@ -1,187 +1,179 @@
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
license: other
|
4 |
-
license_name: nvidia-
|
5 |
license_link: >-
|
6 |
-
https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-
|
7 |
pipeline_tag: text-generation
|
8 |
tags:
|
9 |
- nvidia
|
10 |
- pytorch
|
11 |
---
|
12 |
|
13 |
-
#
|
14 |
|
15 |
## Model Overview
|
16 |
|
17 |
-
|
18 |
|
19 |
-
|
20 |
|
21 |
-
|
|
|
|
|
22 |
|
23 |
-
This model is part of the Nemotron-H Collection. You can find the models in this family here:
|
24 |
-
- [Nemotron-H-56B-Base-8K](https://huggingface.co/nvidia/Nemotron-H-56B-Base-8K)
|
25 |
-
- [Nemotron-H-47B-Base-8K](https://huggingface.co/nvidia/Nemotron-H-47B-Base-8K)
|
26 |
-
- [Nemotron-H-8B-Base-8K](https://huggingface.co/nvidia/Nemotron-H-8B-Base-8K)
|
27 |
|
28 |
## License/Terms of Use
|
29 |
|
30 |
-
GOVERNING TERMS:
|
31 |
|
32 |
**Model Developer:** NVIDIA
|
33 |
|
34 |
-
**Model Dates:**
|
35 |
-
|
36 |
-
October 2024 - March 2025
|
37 |
-
|
38 |
-
**Data Freshness:**
|
39 |
-
|
40 |
-
September 2024
|
41 |
-
|
42 |
-
The pretraining data has a cutoff date of September 2024.
|
43 |
-
|
44 |
|
45 |
-
## Use Case:
|
46 |
|
47 |
-
|
|
|
48 |
|
49 |
## Release Date:
|
50 |
|
51 |
-
|
52 |
|
53 |
## References
|
54 |
|
55 |
-
- [\[2504.
|
56 |
|
57 |
## Model Architecture
|
58 |
-
- Architecture Type:
|
59 |
-
- Network Architecture:
|
60 |
|
61 |
-
This model
|
|
|
62 |
|
63 |
-
##
|
64 |
-
- Input Type(s): Text
|
65 |
-
- Input Format(s): String
|
66 |
-
- Input Parameters: One-Dimensional (1D): Sequences
|
67 |
-
- Other Properties Related to Input: Context length up to 8K. Supported languages include German, Spanish, French, Italian, Korean, Portuguese, Russian, Japanese, Chinese and English.
|
68 |
|
69 |
-
|
70 |
-
- Output Type(s): Text
|
71 |
-
- Output Format: String
|
72 |
-
- Output Parameters: One-Dimensional (1D): Sequences
|
73 |
|
74 |
-
|
|
|
|
|
|
|
|
|
75 |
|
76 |
-
##
|
77 |
-
-
|
78 |
-
-
|
79 |
-
-
|
|
|
80 |
|
81 |
-
##
|
82 |
-
-
|
|
|
|
|
|
|
|
|
83 |
|
84 |
-
##
|
|
|
85 |
|
86 |
-
|
87 |
|
88 |
-
|
89 |
|
90 |
-
|
91 |
-
|
92 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
93 |
-
|
94 |
-
# Load the tokenizer and model
|
95 |
-
tokenizer = AutoTokenizer.from_pretrained("nvidia/Nemotron-H-56B-Base-8K", trust_remote_code=True)
|
96 |
-
model = AutoModelForCausalLM.from_pretrained("nvidia/Nemotron-H-56B-Base-8K", torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto")
|
97 |
|
98 |
-
|
|
|
99 |
|
100 |
-
|
101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
```
|
103 |
|
104 |
-
## Training
|
105 |
|
106 |
-
|
107 |
|
108 |
-
|
109 |
|
110 |
-
**Data Collection for Training
|
111 |
-
Hybrid: Automated, Human, Synthetic
|
112 |
|
113 |
-
|
114 |
-
Hybrid: Automated, Human, Synthetic
|
115 |
|
116 |
-
|
117 |
|
118 |
-
|
119 |
|
120 |
-
|
121 |
-
Hybrid: Human, Synthetic
|
122 |
|
123 |
-
|
124 |
-
Hybrid: Human, Synthetic, Automatic
|
125 |
-
|
126 |
-
#### Commonsense Understanding Evaluations:
|
127 |
-
|
128 |
-
| ARC Challenge 25-shot | Hellaswag 10-shot | Winogrande 5-shot | CommonsenseQA 7-shot |
|
129 |
-
|-------------|--------------|-----------------|------------------|
|
130 |
-
| 94.97 | 89.00 | 84.45 | 86.73 |
|
131 |
|
132 |
-
|
133 |
-
- Hellaswag - Tests the ability of a language model to correctly finish the provided context from a choice of possible options. [Dataset](https://huggingface.co/datasets/Rowan/hellaswag )
|
134 |
-
- Winogrande - Tests the ability to choose the right option for a given sentence which requires commonsense reasoning. [Dataset](https://huggingface.co/datasets/allenai/winogrande )
|
135 |
-
- CommonsenseQA - A multiple-choice question answering dataset that requires different types of commonsense knowledge to predict the correct answers. [Dataset](https://huggingface.co/datasets/tau/commonsense_qa )
|
136 |
|
137 |
-
|
138 |
|
139 |
-
|
140 |
-
|-------------|--------------|-----------------|------------------|
|
141 |
-
| 77.82 | 67.20| 60.37 | 54.27 |
|
142 |
|
143 |
-
-
|
144 |
-
- MBPP+ - Extended version of MBPP with additional validation. [Dataset](https://huggingface.co/datasets/evalplus/mbppplus)
|
145 |
-
- HumanEval - Tests code generation and completion abilities in Python. [Dataset](https://github.com/openai/human-eval)
|
146 |
|
147 |
-
#### Math Evaluations:
|
148 |
|
|
|
149 |
|
150 |
-
|
151 |
-
|--------------|------------|------------|------------|
|
152 |
-
| 93.71 | 59.42 | 35.19 | 57.37 |
|
153 |
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
|
|
|
159 |
|
160 |
-
|
|
|
161 |
|
|
|
162 |
|
163 |
-
|
164 |
-
|
165 |
-
|
|
|
|
|
166 |
|
167 |
-
|
168 |
-
[Dataset](https://huggingface.co/datasets/TIGER-Lab/MMLU-Pro)
|
169 |
-
- MMLU - Tests knowledge across 57 subjects including science, humanities, math and more. [Dataset](https://github.com/hendrycks/test)
|
170 |
|
171 |
-
|
|
|
172 |
|
173 |
-
|
174 |
|
175 |
-
|
|
|
|
|
|
|
|
|
176 |
|
177 |
-
##
|
178 |
-
- Engine: NeMo
|
179 |
-
- Test Hardware NVIDIA H100-80GB
|
180 |
|
181 |
-
|
182 |
-
NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.
|
183 |
|
184 |
-
For more detailed information on ethical considerations for this model, please see the
|
185 |
|
186 |
Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
|
187 |
-
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
license: other
|
4 |
+
license_name: nvidia-open-model-license
|
5 |
license_link: >-
|
6 |
+
https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/
|
7 |
pipeline_tag: text-generation
|
8 |
tags:
|
9 |
- nvidia
|
10 |
- pytorch
|
11 |
---
|
12 |
|
13 |
+
# OpenCodeReasoning-Distill-Qwen-7B-Instruct
|
14 |
|
15 |
## Model Overview
|
16 |
|
17 |
+
Llama-3.1-Nemotron-Ultra-253B-v1 is a large language model (LLM) which is a derivative of [Meta Llama-3.1-405B-Instruct](https://huggingface.co/meta-llama/Llama-3.1-405B-Instruct) (AKA the *reference model*). It is a reasoning model that is post trained for reasoning, human chat preferences, and tasks, such as RAG and tool calling. The model supports a context length of 128K tokens. This model fits on a single 8xH100 node for inference.
|
18 |
|
19 |
+
Llama-3.1-Nemotron-Ultra-253B-v1 is a model which offers a great tradeoff between model accuracy and efficiency. Efficiency (throughput) directly translates to savings. Using a novel Neural Architecture Search (NAS) approach, we greatly reduce the model’s memory footprint, enabling larger workloads, as well as reducing the number of GPUs required to run the model in a data center environment. This NAS approach enables the selection of a desired point in the accuracy-efficiency tradeoff. Furthermore, by using a novel method to vertically compress the model (see details [here](https://arxiv.org/abs/2503.18908)), it also offers a significant improvement in latency.
|
20 |
|
21 |
+
The model underwent a multi-phase post-training process to enhance both its reasoning and non-reasoning capabilities. This includes a supervised fine-tuning stage for Math, Code, Reasoning, Chat, and Tool Calling as well as multiple reinforcement learning (RL) stages using Group Relative Policy Optimization (GRPO) algorithms for reasoning, chat, and instruction-following.
|
22 |
+
|
23 |
+
This model is ready for commercial use.
|
24 |
|
|
|
|
|
|
|
|
|
25 |
|
26 |
## License/Terms of Use
|
27 |
|
28 |
+
GOVERNING TERMS: Your use of this model is governed by the [NVIDIA Open Model License.](https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/) Additional Information: [Llama 3.1 Community License Agreement](https://www.llama.com/llama3\_1/license/). Built with Qwen.
|
29 |
|
30 |
**Model Developer:** NVIDIA
|
31 |
|
32 |
+
**Model Dates:** Trained between February 2025 and March 2025
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
|
|
34 |
|
35 |
+
### Use Case:
|
36 |
+
Developers designing AI-powered code generation applications. Also suitable for typical instruction-following tasks.
|
37 |
|
38 |
## Release Date:
|
39 |
|
40 |
+
2025-04-21
|
41 |
|
42 |
## References
|
43 |
|
44 |
+
- [\[2504.01943\] OpenCodeReasoning: Advancing Data Distillation for Competitive Coding](https://arxiv.org/abs/2504.01943)
|
45 |
|
46 |
## Model Architecture
|
47 |
+
- Architecture Type: Dense decoder-only Transformer model
|
48 |
+
- Network Architecture: Qwen
|
49 |
|
50 |
+
**This model was developed based on Qwen2.5-7B-Instruct <br>
|
51 |
+
** This model has 7B of model parameters. <br>
|
52 |
|
53 |
+
## Intended use
|
|
|
|
|
|
|
|
|
54 |
|
55 |
+
OpenCodeReasoning-Distill-Qwen-7B-Instruct is a competitive code generation focused reasoning and chat model intended to be used in English.
|
|
|
|
|
|
|
56 |
|
57 |
+
## Input
|
58 |
+
- **Input Type:** Text
|
59 |
+
- **Input Format:** String
|
60 |
+
- **Input Parameters:** One-Dimensional (1D)
|
61 |
+
- **Other Properties Related to Input:** Context length up to 32,768 tokens
|
62 |
|
63 |
+
## Output
|
64 |
+
- **Output Type:** Text
|
65 |
+
- **Output Format:** String
|
66 |
+
- **Output Parameters:** One-Dimensional (1D)
|
67 |
+
- **Other Properties Related to Output:** Context length up to 32,768 tokens
|
68 |
|
69 |
+
## Software Integration
|
70 |
+
- **Runtime Engine:** Transformers
|
71 |
+
- **Recommended Hardware Microarchitecture Compatibility:**
|
72 |
+
- NVIDIA Hopper
|
73 |
+
- NVIDIA Ampere
|
74 |
+
- **Preferred Operating System(s):** Linux
|
75 |
|
76 |
+
## Model Version
|
77 |
+
1.0 (4/21/2025)
|
78 |
|
79 |
+
## Quick Start and Usage Recommendations:
|
80 |
|
81 |
+
We recommend setting temperature to \`0.6\`, and Top P to \`0.95\` for inference on LiveCodeBench.
|
82 |
|
83 |
+
### Use It with Transformers
|
84 |
+
See the snippet below for usage with [Hugging Face Transformers](https://huggingface.co/docs/transformers/main/en/index) library. Please see the example below.
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
+
We recommend using the *transformers* package with version 4.48.3.
|
87 |
+
Example:
|
88 |
|
89 |
+
```py
|
90 |
+
import torch
|
91 |
+
import transformers
|
92 |
+
|
93 |
+
model_id = "nvidia/OpenCodeReasoning-Distill-Qwen-7B-Instruct"
|
94 |
+
model_kwargs = {"torch_dtype": torch.bfloat16, "trust_remote_code": True, "device_map": "auto"}
|
95 |
+
tokenizer = transformers.AutoTokenizer.from_pretrained(model_id)
|
96 |
+
tokenizer.pad_token_id = tokenizer.eos_token_id
|
97 |
+
|
98 |
+
pipeline = transformers.pipeline(
|
99 |
+
"text-generation",
|
100 |
+
model=model_id,
|
101 |
+
tokenizer=tokenizer,
|
102 |
+
max_new_tokens=32768,
|
103 |
+
temperature=0.6,
|
104 |
+
top_p=0.95,
|
105 |
+
**model_kwargs
|
106 |
+
)
|
107 |
+
|
108 |
+
print(pipeline([{"role": "user", "content": "Solve x*(sin(x)+2)=0"}]))
|
109 |
```
|
110 |
|
111 |
+
## Training and Evaluation Datasets
|
112 |
|
113 |
+
## Training Datasets
|
114 |
|
115 |
+
This model is trained using [OpenCodeReasoning](https://huggingface.co/datasets/nvidia/OpenCodeReasoning) dataset.
|
116 |
|
117 |
+
**Data Collection for Training Datasets:**
|
|
|
118 |
|
119 |
+
- Hybrid: Automated, Human, Synthetic
|
|
|
120 |
|
121 |
+
**Data Labeling for Training Datasets:**
|
122 |
|
123 |
+
- Hybrid: Automated, Human, Synthetic
|
124 |
|
125 |
+
## Evaluation Datasets
|
|
|
126 |
|
127 |
+
We used the datasets listed in the next section to evaluate Llama-3.1-Nemotron-Ultra-253B-v1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
+
Data Collection for Evaluation Datasets:
|
|
|
|
|
|
|
130 |
|
131 |
+
- Hybrid: Human/Synthetic
|
132 |
|
133 |
+
Data Labeling for Evaluation Datasets:
|
|
|
|
|
134 |
|
135 |
+
- Hybrid: Human/Synthetic/Automatic
|
|
|
|
|
136 |
|
|
|
137 |
|
138 |
+
## Evaluation Results
|
139 |
|
140 |
+
### LiveCodeBench (20240801-20250201)
|
|
|
|
|
141 |
|
142 |
+
| Models | Pass@1 |
|
143 |
+
|--------------|------------|
|
144 |
+
| R1-Distill-Qwen-7B | 37.6 |
|
145 |
+
| OpenCodeReasoning-Distill-Qwen-7B-Instruct | 51.3 |
|
146 |
|
147 |
+
User Prompt Template (without starter code):
|
148 |
|
149 |
+
````
|
150 |
+
"You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
|
151 |
|
152 |
+
Question: {prompt}
|
153 |
|
154 |
+
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within delimiters as follows. Ensure that when the python program runs, it reads the inputs, runs the algorithm and writes output to STDOUT.
|
155 |
+
```python
|
156 |
+
# YOUR CODE HERE
|
157 |
+
```
|
158 |
+
````
|
159 |
|
160 |
+
User Prompt Template (with starter code):
|
|
|
|
|
161 |
|
162 |
+
````
|
163 |
+
You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
|
164 |
|
165 |
+
Question: {prompt}
|
166 |
|
167 |
+
You will use the following starter code to write the solution to the problem and enclose your code within delimiters.
|
168 |
+
```python
|
169 |
+
{starter_code}
|
170 |
+
```
|
171 |
+
````
|
172 |
|
173 |
+
## Ethical Considerations:
|
|
|
|
|
174 |
|
175 |
+
NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.
|
|
|
176 |
|
177 |
+
For more detailed information on ethical considerations for this model, please see the Model Card++ [Explainability](./EXPLAINABILITY.md), [Bias](./BIAS.md), [Safety & Security](./SAFETY_and_SECURITY.md), and [Privacy](./PRIVACY.md) Subcards.
|
178 |
|
179 |
Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
|
|