初始化项目,由ModelHub XC社区提供模型

Model: nvidia/Nemotron-4-Mini-Hindi-4B-Base
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-09-06 02:00:17 +08:00
commit ab649641d3
9 changed files with 8249 additions and 0 deletions

37
.gitattributes vendored Normal file
View File

@@ -0,0 +1,37 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
tokenizer.json filter=lfs diff=lfs merge=lfs -text
nemotron-4-mini-hindi-4b-base.nemo filter=lfs diff=lfs merge=lfs -text

132
README.md Normal file
View File

@@ -0,0 +1,132 @@
---
license: other
license_name: nvidia-open-model-license
license_link: >-
https://developer.download.nvidia.com/licenses/nvidia-open-model-license-agreement-june-2024.pdf
language:
- en
- hi
base_model: nvidia/Minitron-4B-Base
library_name: nemo
---
# Model Overview
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 (400B tokens) exclusively to create a strong base model for Hindi, English, and Hinglish. We make extensive use of synthetic data during the continuous pre-training stage. The base small language model (SLM) is optimized through distillation, pruning, and quantization for speed and on-device deployment.
Please refer to our [arXiv paper](https://arxiv.org/abs/2410.14815) for more details. The intruction tuned version of this model is [nvidia/Nemotron-4-Mini-Hindi-4B-Instruct](https://huggingface.co/nvidia/Nemotron-4-Mini-Hindi-4B-Instruct).
This model is for research and development only.
**Model Developer:** NVIDIA
**Model Dates:** Nemotron-4-Mini-Hindi-4B-Base was trained between June 2024 and Sept 2024.
## License
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).
## Model Architecture
Nemotron-4-Mini-Hindi-4B-Base uses a model embedding size of 3072, 32 attention heads, and an MLP intermediate dimension of 9216.
It also uses Grouped-Query Attention (GQA) and Rotary Position Embeddings (RoPE).
**Architecture Type:** Transformer Decoder (auto-regressive language model)
**Network Architecture:** Nemotron-4
**Input Type:** Text
**Input Format:** String
**Input Parameters:** None
**Other Properties Related to Input:** None
**Output Type:** Text
**Output Format:** String
**Output Parameters:** None
**Other Properties Related to Output:** None
## Usage
Support for Nemotron models is added to the [transformers library](https://huggingface.co/docs/transformers/en/model_doc/nemotron)
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.
```python
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
# Load the tokenizer and model
model_path = 'nvidia/Nemotron-4-Mini-Hindi-4B-Base'
tokenizer = AutoTokenizer.from_pretrained(model_path)
device = 'cuda'
dtype = torch.bfloat16
model = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype=dtype, device_map=device)
# Prepare the input text
prompt = 'भारत की राजधानी क्या है?'
inputs = tokenizer.encode(prompt, return_tensors='pt').to(model.device)
# Generate the output
outputs = model.generate(inputs, max_length=15)
# Decode and print the output
output_text = tokenizer.decode(outputs[0])
print(output_text)
```
## Dataset & Training
**Data Collection Method:** Hybrid
**Labeling Method:** Not Applicable
**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.
**Data Freshness:** The pre-training data has a cutoff of June 2023.
## Evaluation Results
*Zero-shot performance.* Evaluated using select Hindi datasets from the [Airavata Evaluation Framework](https://github.com/AI4Bharat/IndicInstruct) with additions:
| MMLU | ARC-C | ARC-E | HellaSwag | BoolQ |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| 49.89 | 65.02 | 78.81 | 31.66 | 71.71 |
Please refer to our [paper](https://arxiv.org/abs/2410.14815) for the full set of results.
## Inference
**Engine:** TensorRT-LLM
**Test Hardware:** NVIDIA A100
**DType:** Float16/BFloat16
## Limitations
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.
## Ethical Considerations
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/).
## Citation
If you find our work helpful, please consider citing our paper:
```
@article{hindinemotron2024,
title={Adapting Multilingual LLMs to Low-Resource Languages using Continued Pre-training and Synthetic Corpus},
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},
journal={arXiv preprint arXiv:2410.14815},
year={2024},
url={https://arxiv.org/abs/2410.14815},
}
```

26
config.json Normal file
View File

@@ -0,0 +1,26 @@
{
"_name_or_path": "nvidia/nemotron-4-mini-hindi-4b-base",
"architectures": [
"NemotronForCausalLM"
],
"bos_token_id": 2,
"eos_token_id": 3,
"hidden_act": "relu2",
"hidden_size": 3072,
"initializer_range": 0.0134,
"intermediate_size": 9216,
"max_position_embeddings": 4096,
"model_type": "nemotron",
"num_attention_heads": 24,
"num_hidden_layers": 32,
"num_key_value_heads": 8,
"norm_eps": 1e-05,
"rope_theta": 10000,
"partial_rotary_factor": 0.5,
"tie_word_embeddings": false,
"torch_dtype": "bfloat16",
"transformers_version": "4.32.0.dev0",
"use_cache": true,
"vocab_size": 256000,
"kv_channels": 128
}

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fea313260a1b376e1fbe58133e8fcdb650904f46c09b4f96ab78939b8c4cbfea
size 8391639040

3
pytorch_model.bin Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:be973523572cf7106a41d4676e632d8fa29f78d1f34c7b039d3723feeba47c53
size 8381129342

4
special_tokens_map.json Normal file
View File

@@ -0,0 +1,4 @@
{
"bos_token": "<s>",
"eos_token": "</s>"
}

3
tokenizer.json Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:83d0648daa0467fb02ddef7ff25460321dab2fbb20c280ae0bc1ea8052f7df90
size 18143149

3
tokenizer.model Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6dfd8b970f437002fc445214304969fe59e64d4f48500bd0b77ba55340f2d811
size 4545602

8038
tokenizer_config.json Normal file

File diff suppressed because it is too large Load Diff