ravirajoshi
commited on
Commit
•
7624c49
1
Parent(s):
ac81e1e
Update README.md
Browse files
README.md
CHANGED
@@ -1,6 +1,132 @@
|
|
1 |
-
---
|
2 |
-
license: other
|
3 |
-
license_name: nvidia-open-model-license
|
4 |
-
license_link: >-
|
5 |
-
https://developer.download.nvidia.com/licenses/nvidia-open-model-license-agreement-june-2024.pdf
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: other
|
3 |
+
license_name: nvidia-open-model-license
|
4 |
+
license_link: >-
|
5 |
+
https://developer.download.nvidia.com/licenses/nvidia-open-model-license-agreement-june-2024.pdf
|
6 |
+
language:
|
7 |
+
- en
|
8 |
+
- hi
|
9 |
+
base_model: nvidia/Minitron-4B-Base
|
10 |
+
library_name: nemo
|
11 |
+
---
|
12 |
+
|
13 |
+
# Model Overview
|
14 |
+
|
15 |
+
Nemotron-4-Mini-Hindi-4B-Base is a base model pre-trained on Hindi and English corpus. The Nemotron-Mini-4B-Base (Minitron-4B) is subject to continuous pre-training using Hindi and English data exclusively to create a strong base model for Hindi. It is a small language model (SLM) optimized through distillation, pruning, and quantization for speed and on-device deployment. VRAM usage has been minimized to approximately 2 GB, providing significantly faster time to first token compared to LLMs.
|
16 |
+
Please refer to our [arXiv paper](https://arxiv.org/abs/2410.14815) for more details.
|
17 |
+
|
18 |
+
This model is for research and development only.
|
19 |
+
|
20 |
+
**Model Developer:** NVIDIA
|
21 |
+
|
22 |
+
**Model Dates:** Nemotron-4-Mini-Hindi-4B-Base was trained between June 2024 and Oct 2024.
|
23 |
+
|
24 |
+
## License
|
25 |
+
|
26 |
+
Nemotron-4-Mini-Hindi-4B-Base is released under the [NVIDIA Open Model License Agreement](https://developer.download.nvidia.com/licenses/nvidia-open-model-license-agreement-june-2024.pdf).
|
27 |
+
|
28 |
+
## Model Architecture
|
29 |
+
|
30 |
+
Nemotron-4-Mini-Hindi-4B-Base uses a model embedding size of 3072, 32 attention heads, and an MLP intermediate dimension of 9216.
|
31 |
+
It also uses Grouped-Query Attention (GQA) and Rotary Position Embeddings (RoPE).
|
32 |
+
|
33 |
+
**Architecture Type:** Transformer Decoder (auto-regressive language model)
|
34 |
+
|
35 |
+
**Network Architecture:** Nemotron-4
|
36 |
+
|
37 |
+
**Input Type:** Text
|
38 |
+
|
39 |
+
**Input Format:** String
|
40 |
+
|
41 |
+
**Input Parameters:** None
|
42 |
+
|
43 |
+
**Other Properties Related to Input:** None
|
44 |
+
|
45 |
+
**Output Type:** Text
|
46 |
+
|
47 |
+
**Output Format:** String
|
48 |
+
|
49 |
+
**Output Parameters:** None
|
50 |
+
|
51 |
+
**Other Properties Related to Output:** None
|
52 |
+
|
53 |
+
## Usage
|
54 |
+
|
55 |
+
Support for Nemotron models is added to the [transformers library](https://huggingface.co/docs/transformers/en/model_doc/nemotron)
|
56 |
+
|
57 |
+
|
58 |
+
The following code provides an example of how to load the Nemotron-4-Mini-Hindi-4B-Base model and use it to perform text generation.
|
59 |
+
|
60 |
+
```python
|
61 |
+
import torch
|
62 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
63 |
+
|
64 |
+
# Load the tokenizer and model
|
65 |
+
model_path = 'nvidia/Nemotron-4-Mini-Hindi-4B-Base'
|
66 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
67 |
+
|
68 |
+
device = 'cuda'
|
69 |
+
dtype = torch.bfloat16
|
70 |
+
model = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype=dtype, device_map=device)
|
71 |
+
|
72 |
+
# Prepare the input text
|
73 |
+
prompt = 'भारत की संस्कृति के बारे में बताएं।'
|
74 |
+
inputs = tokenizer.encode(prompt, return_tensors='pt').to(model.device)
|
75 |
+
|
76 |
+
# Generate the output
|
77 |
+
outputs = model.generate(inputs, max_length=20)
|
78 |
+
|
79 |
+
# Decode and print the output
|
80 |
+
output_text = tokenizer.decode(outputs[0])
|
81 |
+
print(output_text)
|
82 |
+
```
|
83 |
+
|
84 |
+
## Dataset & Training
|
85 |
+
|
86 |
+
**Data Collection Method:** Hybrid
|
87 |
+
|
88 |
+
**Labeling Method:** Not Applicable
|
89 |
+
|
90 |
+
**Properties:** The Nemotron-Mini-4B base model is used for continuous pre-training. The Nemotron-Mini-4B model is derived from the Nemotron-15B model using compression techniques such as pruning and distillation, consisting of 2.6B trainable parameters. Re-training is performed using a standard causal modeling objective. The dataset consists of 400B tokens, with an equal mix of Hindi and English. The corpus spans domains including legal, math, science, finance, and more. Our sources cover a variety of document types such as: webpages, dialogue, articles, and other written materials.
|
91 |
+
|
92 |
+
**Data Freshness:** The pre-training data has a cutoff of June 2023.
|
93 |
+
|
94 |
+
## Evaluation Results
|
95 |
+
|
96 |
+
*Zero-shot performance.* Evaluated using select datasets from the [IndicInstruct](https://github.com/AI4Bharat/IndicInstruct) with additions:
|
97 |
+
|
98 |
+
| MMLU | ARC-C | ARC-E | HellaSwag | BoolQ |
|
99 |
+
| :------------- | :------------- | :------------- | :------------- | :------------- |
|
100 |
+
| 49.89 | 65.02 | 78.81 | 31.66 | 71.71 |
|
101 |
+
|
102 |
+
|
103 |
+
Please refer to our [paper](https://arxiv.org/abs/2410.14815) for the full set of results.
|
104 |
+
|
105 |
+
## Inference
|
106 |
+
**Engine:** TensorRT-LLM
|
107 |
+
|
108 |
+
**Test Hardware:** NVIDIA A100
|
109 |
+
|
110 |
+
**DType:** Float16/BFloat16
|
111 |
+
|
112 |
+
## Limitations
|
113 |
+
|
114 |
+
The model was trained on data that contains toxic language and societal biases, originally crawled from the internet. Therefore, the model may amplify those biases and return toxic responses, especially when prompted with toxic prompts. The model may generate answers that may be inaccurate, omit key information, or include irrelevant or redundant text producing socially unacceptable or undesirable text, even if the prompt itself does not include anything explicitly offensive. The model may answer with I statements, exhibiting some anthropomorphizing. This issue could be exacerbated without the use of the recommended prompt template.
|
115 |
+
|
116 |
+
## Ethical Considerations
|
117 |
+
|
118 |
+
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. Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
|
119 |
+
|
120 |
+
|
121 |
+
## Citation
|
122 |
+
|
123 |
+
If you find our work helpful, please consider citing our paper:
|
124 |
+
```
|
125 |
+
@article{hindiminitron2024,
|
126 |
+
title={Adapting Multilingual LLMs to Low-Resource Languages using Continued Pre-training and Synthetic Corpus},
|
127 |
+
author={Raviraj Joshi and Kanishk Singla and Anusha Kamath and Raunak Kalani and Rakesh Paul and Utkarsh Vaidya and Sanjay Singh Chauhan and Niranjan Wartikar and Eileen Long},
|
128 |
+
journal={arXiv preprint arXiv:2410.14815},
|
129 |
+
year={2024},
|
130 |
+
url={https://arxiv.org/abs/2410.14815},
|
131 |
+
}
|
132 |
+
```
|