Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
@@ -1,199 +1,273 @@
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
-
tags:
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
-
#
|
7 |
|
8 |
-
|
9 |
|
10 |
|
|
|
11 |
|
12 |
-
|
|
|
|
|
|
|
13 |
|
14 |
-
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
19 |
-
|
20 |
-
- **Developed by:** [More Information Needed]
|
21 |
-
- **Funded by [optional]:** [More Information Needed]
|
22 |
-
- **Shared by [optional]:** [More Information Needed]
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
-
|
28 |
-
### Model Sources [optional]
|
29 |
-
|
30 |
-
<!-- Provide the basic links for the model. -->
|
31 |
-
|
32 |
-
- **Repository:** [More Information Needed]
|
33 |
-
- **Paper [optional]:** [More Information Needed]
|
34 |
-
- **Demo [optional]:** [More Information Needed]
|
35 |
-
|
36 |
-
## Uses
|
37 |
-
|
38 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
39 |
-
|
40 |
-
### Direct Use
|
41 |
-
|
42 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
43 |
-
|
44 |
-
[More Information Needed]
|
45 |
-
|
46 |
-
### Downstream Use [optional]
|
47 |
-
|
48 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
49 |
-
|
50 |
-
[More Information Needed]
|
51 |
-
|
52 |
-
### Out-of-Scope Use
|
53 |
-
|
54 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
55 |
-
|
56 |
-
[More Information Needed]
|
57 |
-
|
58 |
-
## Bias, Risks, and Limitations
|
59 |
-
|
60 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
61 |
-
|
62 |
-
[More Information Needed]
|
63 |
-
|
64 |
-
### Recommendations
|
65 |
-
|
66 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
67 |
-
|
68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
69 |
-
|
70 |
-
## How to Get Started with the Model
|
71 |
-
|
72 |
-
Use the code below to get started with the model.
|
73 |
-
|
74 |
-
[More Information Needed]
|
75 |
-
|
76 |
-
## Training Details
|
77 |
-
|
78 |
-
### Training Data
|
79 |
-
|
80 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
81 |
-
|
82 |
-
[More Information Needed]
|
83 |
-
|
84 |
-
### Training Procedure
|
85 |
-
|
86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
87 |
-
|
88 |
-
#### Preprocessing [optional]
|
89 |
-
|
90 |
-
[More Information Needed]
|
91 |
-
|
92 |
-
|
93 |
-
#### Training Hyperparameters
|
94 |
-
|
95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
-
|
97 |
-
#### Speeds, Sizes, Times [optional]
|
98 |
-
|
99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
100 |
-
|
101 |
-
[More Information Needed]
|
102 |
-
|
103 |
-
## Evaluation
|
104 |
-
|
105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
-
|
107 |
-
### Testing Data, Factors & Metrics
|
108 |
-
|
109 |
-
#### Testing Data
|
110 |
-
|
111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
112 |
-
|
113 |
-
[More Information Needed]
|
114 |
-
|
115 |
-
#### Factors
|
116 |
-
|
117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
-
|
119 |
-
[More Information Needed]
|
120 |
-
|
121 |
-
#### Metrics
|
122 |
-
|
123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
-
|
125 |
-
[More Information Needed]
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
|
131 |
-
|
132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
|
|
|
134 |
|
135 |
-
##
|
136 |
|
137 |
-
|
138 |
|
139 |
-
|
|
|
|
|
140 |
|
141 |
-
|
142 |
|
143 |
-
|
144 |
|
145 |
-
|
|
|
|
|
146 |
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
|
153 |
-
##
|
154 |
|
155 |
-
|
|
|
|
|
|
|
156 |
|
157 |
-
[More Information Needed]
|
158 |
|
159 |
-
|
160 |
|
161 |
-
|
|
|
162 |
|
163 |
-
|
|
|
164 |
|
165 |
-
|
|
|
|
|
|
|
|
|
|
|
166 |
|
167 |
-
|
168 |
|
169 |
-
|
170 |
|
171 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
|
173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
|
175 |
-
**BibTeX:**
|
176 |
|
177 |
-
|
178 |
|
179 |
-
|
180 |
|
181 |
-
|
|
|
|
|
182 |
|
183 |
-
## Glossary [optional]
|
184 |
|
185 |
-
|
186 |
|
187 |
-
|
188 |
|
189 |
-
|
190 |
|
191 |
-
[
|
192 |
|
193 |
-
##
|
194 |
|
195 |
-
|
196 |
|
197 |
-
## Model Card
|
|
|
198 |
|
199 |
-
[More Information Needed]
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
+
tags:
|
4 |
+
- mistral
|
5 |
+
- instruct
|
6 |
+
- quantization
|
7 |
+
- 4bit
|
8 |
+
- bitsandbytes
|
9 |
+
- causal-lm
|
10 |
---
|
11 |
|
12 |
+
# 4bit Quantized Model: Mistral-7B-Instruct-v0.3
|
13 |
|
14 |
+
This is a 4bit quantized variant of [mistralai/Mistral-7B-Instruct-v0.3](https://https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3), optimized to reduce memory footprint and accelerate inference while maintaining high output similarity.
|
15 |
|
16 |
|
17 |
+
## Overview
|
18 |
|
19 |
+
Mistral-7B-Instruct-v0.3 is an instruction fine-tuned model derived from Mistral-7B-v0.3, featuring:
|
20 |
+
- An extended 32,768 token vocabulary.
|
21 |
+
- Support for v3 tokenizer.
|
22 |
+
- Built-in function calling capabilities.
|
23 |
|
24 |
+
This quantized checkpoint was produced with [BitsAndBytes](https://github.com/bitsandbytes-foundation/bitsandbytes) and evaluated using standard text similarity metrics.
|
25 |
|
26 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
+
## Model Architecture
|
29 |
|
30 |
+
| Attribute | Value |
|
31 |
+
|-------------------------|--------------------------------|
|
32 |
+
| **Model class** | MistralForCausalLM |
|
33 |
+
| **Number of parameters**| 3,758,362,624 |
|
34 |
+
| **Hidden size** | 4096 |
|
35 |
+
| **Number of layers** | 32 |
|
36 |
+
| **Attention heads** | 32 |
|
37 |
+
| **Vocabulary size** | 32768 |
|
38 |
+
| **Compute dtype** | torch.bfloat16 |
|
39 |
|
40 |
+
---
|
41 |
|
42 |
+
## Quantization Configuration
|
43 |
|
44 |
+
The following configuration dictionary was used during quantization:
|
45 |
|
46 |
+
```json
|
47 |
+
{'quant_method': <QuantizationMethod.BITS_AND_BYTES: 'bitsandbytes'>, '_load_in_8bit': False, '_load_in_4bit': True, 'llm_int8_threshold': 6.0, 'llm_int8_skip_modules': None, 'llm_int8_enable_fp32_cpu_offload': False, 'llm_int8_has_fp16_weight': False, 'bnb_4bit_quant_type': 'fp4', 'bnb_4bit_use_double_quant': False, 'bnb_4bit_compute_dtype': 'bfloat16', 'bnb_4bit_quant_storage': 'uint8', 'load_in_4bit': True, 'load_in_8bit': False}
|
48 |
+
```
|
49 |
|
50 |
+
---
|
51 |
|
52 |
+
## Intended Use
|
53 |
|
54 |
+
- Research and experimentation with instruction-following tasks.
|
55 |
+
- Demonstrations of quantized model capabilities in resource-constrained environments.
|
56 |
+
- Prototyping workflows requiring extended vocabulary and function calling support (v3 tokenizer).
|
57 |
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
+
## Limitations
|
60 |
|
61 |
+
- May reproduce biases and factual inaccuracies present in the original model.
|
62 |
+
- This instruct variant does not include any moderation or safety guardrails by default.
|
63 |
+
- Quantization can reduce generation diversity and precision.
|
64 |
+
- Not intended for production without thorough evaluation and alignment testing.
|
65 |
|
|
|
66 |
|
67 |
+
## Usage
|
68 |
|
69 |
+
```python
|
70 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
71 |
|
72 |
+
tokenizer = AutoTokenizer.from_pretrained("PJEDeveloper/Mistral-7B-Instruct-v0.3-4bit-20250716_003938")
|
73 |
+
model = AutoModelForCausalLM.from_pretrained("PJEDeveloper/Mistral-7B-Instruct-v0.3-4bit-20250716_003938", device_map="auto")
|
74 |
|
75 |
+
prompt = "Explain the concept of reinforcement learning."
|
76 |
+
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
77 |
+
outputs = model.generate(**inputs, max_new_tokens=256)
|
78 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
79 |
+
```
|
80 |
+
## Function Calling
|
81 |
|
82 |
+
For function calling workflows, please see the [Transformers Function Calling Guide](https://huggingface.co/docs/transformers/main/en/model_doc/mistral3#overview) and the original [Mistral examples](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3).
|
83 |
|
84 |
+
---
|
85 |
|
86 |
+
Prompt Used for Evaluation
|
87 |
+
|
88 |
+
```text
|
89 |
+
You are an expert assistant helping a user plan a themed event.
|
90 |
+
|
91 |
+
Please complete the following tasks:
|
92 |
+
|
93 |
+
Event Summary: Write a concise paragraph (3-5 sentences) describing a steampunk-themed anniversary party in a unique style, incorporating at least two uncommon English words from the extended vocabulary (for example, pulchritudinous, vicissitude, susurration, ephemeral, etc.).
|
94 |
+
|
95 |
+
Guest List JSON: Create a JSON array listing five fictional guests, each with the following fields:
|
96 |
+
|
97 |
+
"name": A full name.
|
98 |
+
|
99 |
+
"role": e.g., "Inventor", "Airship Captain".
|
100 |
+
|
101 |
+
"special_item": A unique steampunk artifact.
|
102 |
+
|
103 |
+
Checklist Function Call: Format the following checklist as a function call named create_event_checklist with a single argument items, which should be a list of strings. The checklist items are:
|
104 |
+
|
105 |
+
"Order brass goggles"
|
106 |
+
|
107 |
+
"Prepare mechanical owl centerpiece"
|
108 |
+
|
109 |
+
"Send invitations"
|
110 |
+
|
111 |
+
"Arrange clockwork music ensemble"
|
112 |
+
|
113 |
+
"Book airship docking slot"
|
114 |
+
|
115 |
+
Respond in three sections labeled Event Summary, Guest List JSON, and Checklist Function Call.
|
116 |
+
|
117 |
+
Make sure all JSON is properly formatted and the function call syntax is valid.
|
118 |
+
```
|
119 |
+
|
120 |
+
Reference Output (Full-weight Model)
|
121 |
+
|
122 |
+
```text
|
123 |
+
Event Summary:
|
124 |
+
Amidst the ephemeral whimsy of a gaslit evening, the anniversary of our esteemed society shall be celebrated in a grand Steampunk extravaganza. The Victorian-esque manor, adorned with intricate brass machinery and gears, shall echo with the susurration of time's relentless march, as we revel in the pulchritudinous splendor of our pulchritudinous past.
|
125 |
+
|
126 |
+
Guest List JSON:
|
127 |
+
|
128 |
+
json
|
129 |
+
|
130 |
+
[
|
131 |
+
{
|
132 |
+
"name": "Professor Archibald F. Brassbolt III",
|
133 |
+
"role": "Inventor",
|
134 |
+
"special_item": "Aether-infused Time-Turner"
|
135 |
+
},
|
136 |
+
{
|
137 |
+
"name": "Captain Amelia Cogsworth",
|
138 |
+
"role": "Airship Captain",
|
139 |
+
"special_item": "The Leviathan - a clockwork airship"
|
140 |
+
},
|
141 |
+
{
|
142 |
+
"name": "Lady Isabella Gearsby",
|
143 |
+
"role": "Society Matron",
|
144 |
+
"special_item": "A diamond-encrusted Steam-Pendulum"
|
145 |
+
},
|
146 |
+
{
|
147 |
+
"name": "Sir Percival Automaton",
|
148 |
+
"role": "Mechanical Knight",
|
149 |
+
"special_item": "A steam-powered automaton suit"
|
150 |
+
},
|
151 |
+
{
|
152 |
+
"name": "Dr. Eleanor Clockwork",
|
153 |
+
"role": "Mad Scientist",
|
154 |
+
"special_item": "A living, breathing steam-powered rose"
|
155 |
+
}
|
156 |
+
]
|
157 |
+
Checklist Function Call:
|
158 |
+
|
159 |
+
python
|
160 |
+
|
161 |
+
def create_event_checklist(items):
|
162 |
+
return "\n".join(items)
|
163 |
+
|
164 |
+
checklist = create_event_checklist(["Order brass goggles", "Prepare mechanical owl centerpiece", "Send invitations", "Arrange clockwork music ensemble", "Book airship docking slot"])
|
165 |
+
With this checklist, we can ensure that our Steampunk anniversary party will be an unforgettable event, filled with the marvels of a bygone era.
|
166 |
+
```
|
167 |
+
|
168 |
+
Quantized Model Output
|
169 |
+
|
170 |
+
```text
|
171 |
+
---
|
172 |
|
173 |
+
Event Summary:
|
174 |
+
In the heart of the industrial ether, where the air is thick with the scent of brass and steam, a grand celebration of marital vicissitude shall unfold. The ephemeral spectacle of a steampunk anniversary party shall be a veritable cornucopia of pulchritudinous contraptions, where the susurration of gears and the hiss of steam shall serenade the guests in a symphony of mechanical harmony.
|
175 |
+
|
176 |
+
Guest List JSON:
|
177 |
+
```
|
178 |
+
[
|
179 |
+
{
|
180 |
+
"name": "Professor Abigail Edison-Smythe",
|
181 |
+
"role": "Inventor",
|
182 |
+
"special_item": "Aether-infused Tesla Coil"
|
183 |
+
},
|
184 |
+
{
|
185 |
+
"name": "Captain Amelia Brassbright",
|
186 |
+
"role": "Airship Captain",
|
187 |
+
"special_item": "Steampowered Parasol"
|
188 |
+
},
|
189 |
+
{
|
190 |
+
"name": "Lord Percival Cogsworth",
|
191 |
+
"role": "Steampunk Poet",
|
192 |
+
"special_item": "Mechanical Quill and Inkwell"
|
193 |
+
},
|
194 |
+
{
|
195 |
+
"name": "Miss Isabella Gearheart",
|
196 |
+
"role": "Steampunk Fashion Designer",
|
197 |
+
"special_item": "Steam-powered Dress with Built-in Fan"
|
198 |
+
},
|
199 |
+
{
|
200 |
+
"name": "Sir Archibald Clockwork",
|
201 |
+
"role": "Clockwork Mechanic",
|
202 |
+
"special_item": "Mechanical Hand with Built-in Compass"
|
203 |
+
}
|
204 |
+
]
|
205 |
+
```
|
206 |
+
|
207 |
+
Checklist Function Call:
|
208 |
+
```
|
209 |
+
def create_event_checklist(items):
|
210 |
+
return "\n".join(items)
|
211 |
+
|
212 |
+
create_event_checklist(["Order brass goggles", "Prepare mechanical owl centerpiece", "Send invitations", "Arrange clockwork music ensemble", "Book airship docking slot"])
|
213 |
+
```
|
214 |
+
```
|
215 |
+
|
216 |
+
## Evaluation Metrics
|
217 |
+
|
218 |
+
| Metric | Value |
|
219 |
+
|-------------------|---------|
|
220 |
+
| ROUGE-L F1 | 0.4581 |
|
221 |
+
| BLEU | 0.2442 |
|
222 |
+
| Cosine Similarity | 0.9141 |
|
223 |
+
| BERTScore F1 | 0.6955 |
|
224 |
+
|
225 |
+
- Higher ROUGE and BLEU scores indicate closer alignment with the original output.
|
226 |
+
|
227 |
+
Interpretation:
|
228 |
+
The quantized model output exhibits moderate similarity to the full-weight model.
|
229 |
+
|
230 |
+
Warning: The quantized output has 3 sentences, while the reference has 6. This may indicate structural divergence.
|
231 |
+
|
232 |
+
## Generation Settings
|
233 |
+
This model produces best results when generated with:
|
234 |
+
|
235 |
+
```python
|
236 |
+
max_new_tokens=1024,
|
237 |
+
do_sample=False,
|
238 |
+
temperature=0.3,
|
239 |
+
top_p=0.9,
|
240 |
+
pad_token_id=tokenizer.eos_token_id
|
241 |
+
```
|
242 |
+
|
243 |
+
## Model Files Metadata
|
244 |
+
|
245 |
+
| Filename | Size (bytes) | SHA-256 |
|
246 |
+
|--------------------|----------------|----------------------------------------------|
|
247 |
+
| `quant_config.txt` | 446 | `f7a08f6dc4b46a4803dce152c536ceed2ee802755840db11231fb5a895b2e022` |
|
248 |
|
|
|
249 |
|
250 |
+
---
|
251 |
|
252 |
+
## Notes
|
253 |
|
254 |
+
- Produced on 2025-07-16T00:43:52.476070.
|
255 |
+
- Quantized automatically using BitsAndBytes.
|
256 |
+
- Base model: mistralai/Mistral-7B-Instruct-v0.3 with extended 32,768-token vocabulary and function calling capabilities.
|
257 |
|
|
|
258 |
|
259 |
+
Intended primarily for research and experimentation.
|
260 |
|
261 |
+
## Citation
|
262 |
|
263 |
+
[Mistralai/Mistral-7B-Instruct-v0.3](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3)
|
264 |
|
265 |
+
[Mistral 7B Announcement](https://mistral.ai/news/announcing-mistral-7b)
|
266 |
|
267 |
+
## License
|
268 |
|
269 |
+
This model is distributed under the Apache 2.0 license, consistent with the original Mistral-7B-Instruct-v0.3.
|
270 |
|
271 |
+
## Model Card Authors
|
272 |
+
This quantized model was prepared by PJEDeveloper.
|
273 |
|
|