GGUF
Inference Endpoints
aashish1904 commited on
Commit
80e505d
1 Parent(s): b50713a

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +159 -0
README.md ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+
4
+ license: other
5
+ license_name: nvidia-open-model-license
6
+ license_link: >-
7
+ https://developer.download.nvidia.com/licenses/nvidia-open-model-license-agreement-june-2024.pdf
8
+
9
+ ---
10
+
11
+ ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)
12
+
13
+ # QuantFactory/Llama-3.1-Minitron-4B-Width-Base-GGUF
14
+ This is quantized version of [nvidia/Llama-3.1-Minitron-4B-Width-Base](https://huggingface.co/nvidia/Llama-3.1-Minitron-4B-Width-Base) created using llama.cpp
15
+
16
+ # Original Model Card
17
+
18
+ # Llama-3.1-Minitron-4B-Width-Base
19
+
20
+ ## Model Overview
21
+
22
+ Llama-3.1-Minitron-4B-Width-Base is a base text-to-text model that can be adopted for a variety of natural language generation tasks.
23
+ It is obtained by pruning Llama-3.1-8B; specifically, we prune model embedding size and MLP intermediate dimension.
24
+ Following pruning, we perform continued training with distillation using 94 billion tokens to arrive at the final model; we use the continuous pre-training data corpus used in Nemotron-4 15B for this purpose. Please refer to our [technical report](https://arxiv.org/abs/2408.11796) for more details.
25
+
26
+ This model is ready for commercial use.
27
+
28
+ **Model Developer:** NVIDIA
29
+
30
+ **Model Dates:** Llama-3.1-Minitron-4B-Width-Base was trained between July 29, 2024 and Aug 3, 2024.
31
+
32
+ ## License
33
+
34
+ This model is released under the [NVIDIA Open Model License Agreement](https://developer.download.nvidia.com/licenses/nvidia-open-model-license-agreement-june-2024.pdf).
35
+
36
+ ## Model Architecture
37
+
38
+ Llama-3.1-Minitron-4B-Width-Base uses a model embedding size of 3072, 32 attention heads, MLP intermediate dimension of 9216, with 32 layers in total. Additionally, it uses Grouped-Query Attention (GQA) and Rotary Position Embeddings (RoPE).
39
+
40
+ **Architecture Type:** Transformer Decoder (Auto-Regressive Language Model)
41
+
42
+ **Network Architecture:** Llama-3.1
43
+
44
+ **Input Type(s):** Text
45
+
46
+ **Input Format(s):** String
47
+
48
+ **Input Parameters:** None
49
+
50
+ **Other Properties Related to Input:** Works well within 8k characters or less.
51
+
52
+ **Output Type(s):** Text
53
+
54
+ **Output Format:** String
55
+
56
+ **Output Parameters:** 1D
57
+
58
+ **Other Properties Related to Output:** None
59
+
60
+
61
+ ## Usage
62
+ Support for this model will be added in the upcoming `transformers` release. In the meantime, please install the library from source:
63
+ ```
64
+ pip install git+https://github.com/huggingface/transformers
65
+ ```
66
+ We can now run inference on this model:
67
+
68
+ ```python
69
+ import torch
70
+ from transformers import AutoTokenizer, LlamaForCausalLM
71
+
72
+ # Load the tokenizer and model
73
+ model_path = "nvidia/Llama-3.1-Minitron-4B-Width-Base"
74
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
75
+
76
+ device = 'cuda'
77
+ dtype = torch.bfloat16
78
+ model = LlamaForCausalLM.from_pretrained(model_path, torch_dtype=dtype, device_map=device)
79
+
80
+ # Prepare the input text
81
+ prompt = 'Complete the paragraph: our solar system is'
82
+ inputs = tokenizer.encode(prompt, return_tensors='pt').to(model.device)
83
+
84
+ # Generate the output
85
+ outputs = model.generate(inputs, max_length=20)
86
+
87
+ # Decode and print the output
88
+ output_text = tokenizer.decode(outputs[0])
89
+ print(output_text)
90
+ ```
91
+
92
+ ## Software Integration
93
+ **Runtime Engine(s):**
94
+ * NeMo 24.05
95
+
96
+ **Supported Hardware Microarchitecture Compatibility:** <br>
97
+ * NVIDIA Ampere
98
+ * NVIDIA Blackwell
99
+ * NVIDIA Hopper
100
+ * NVIDIA Lovelace
101
+
102
+
103
+ **[Preferred/Supported] Operating System(s):** <br>
104
+ * Linux
105
+
106
+ ## Dataset & Training
107
+
108
+ **Data Collection Method by Dataset:** Automated
109
+
110
+ **Labeling Method by Dataset:** Not Applicable
111
+
112
+ **Properties:**
113
+ The training corpus for Llama-3.1-Minitron-4B-Width-Base consists of English and multilingual text, as well as code. Our sources cover a variety of document types such as: webpages, dialogue, articles, and other written materials. The corpus spans domains including legal, math, science, finance, and more. In our continued training set, we introduce a small portion of question-answering, and alignment style data to improve model performance.
114
+
115
+ **Data Freshness:** The pretraining data has a cutoff of June 2023.
116
+
117
+ ## Evaluation Results
118
+
119
+ ### Overview
120
+ _5-shot performance._ Language Understanding evaluated using [Massive Multitask Language Understanding](https://arxiv.org/abs/2009.03300):
121
+
122
+ | Average |
123
+ | :---- |
124
+ | 60.5 |
125
+
126
+ _Zero-shot performance._ Evaluated using select datasets from the [LM Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) with additions:
127
+
128
+ | HellaSwag | Winogrande | GSM8K| ARC-Challenge | XLSum |
129
+ | :---- | :---- | :---- | :---- | :---- |
130
+ | 76.1 | 73.5 | 41.2 | 55.6 | 28.7
131
+
132
+ _Code generation performance._ Evaluated using [MBPP](https://github.com/google-research/google-research/tree/master/mbpp):
133
+ | Score |
134
+ | :---- |
135
+ | 32.0 |
136
+
137
+ ## Inference
138
+
139
+ **Engine:** TensorRT-LLM
140
+
141
+ **Test Hardware:** NVIDIA A100
142
+
143
+ **DType:** BFloat16
144
+
145
+
146
+ ## Limitations
147
+
148
+ The model was trained on data that contains toxic language, unsafe content, 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.
149
+
150
+ ## Ethical Considerations
151
+
152
+ 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.
153
+
154
+ Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
155
+
156
+ ## References
157
+
158
+ * [Compact Language Models via Pruning and Knowledge Distillation](https://arxiv.org/abs/2407.14679)
159
+ * [LLM Pruning and Distillation in Practice: The Minitron Approach](https://arxiv.org/abs/2408.11796)