aashish1904 commited on
Commit
ba4e3d2
·
verified ·
1 Parent(s): 7414f5c

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +141 -0
README.md ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+
4
+ library_name: transformers
5
+ license: apache-2.0
6
+ language:
7
+ - en
8
+
9
+ ---
10
+
11
+ [![QuantFactory Banner](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)](https://hf.co/QuantFactory)
12
+
13
+
14
+ # QuantFactory/SmolLM2-1.7B-GGUF
15
+ This is quantized version of [HuggingFaceTB/SmolLM2-1.7B](https://huggingface.co/HuggingFaceTB/SmolLM2-1.7B) created using llama.cpp
16
+
17
+ # Original Model Card
18
+
19
+
20
+
21
+ # SmolLM2
22
+
23
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/61c141342aac764ce1654e43/XlT5TM3HWpfoZk_HSubrH.png)
24
+
25
+ ## Table of Contents
26
+
27
+ 1. [Model Summary](#model-summary)
28
+ 2. [Evaluation](#evaluation)
29
+ 3. [Limitations](#limitations)
30
+ 4. [Training](#training)
31
+ 5. [License](#license)
32
+ 6. [Citation](#citation)
33
+
34
+ ## Model Summary
35
+
36
+ SmolLM2 is a family of compact language models available in three size: 135M, 360M, and 1.7B parameters. They are capable of solving a wide range of tasks while being lightweight enough to run on-device.
37
+
38
+ The 1.7B variant demonstrates significant advances over its predecessor SmolLM1-1.7B, particularly in instruction following, knowledge, reasoning, and mathematics. It was trained on 11 trillion tokens using a diverse dataset combination: FineWeb-Edu, DCLM, The Stack, along with new mathematics and coding datasets that we curated and will release soon. We developed the instruct version through supervised fine-tuning (SFT) using a combination of public datasets and our own curated datasets. We then applied Direct Preference Optimization (DPO) using [UltraFeedback](https://huggingface.co/datasets/HuggingFaceH4/ultrafeedback_binarized).
39
+
40
+ The instruct model additionally supports tasks such as text rewriting, summarization and function calling thanks to datasets developed by [Argilla](https://huggingface.co/argilla) such as [Synth-APIGen-v0.1](https://huggingface.co/datasets/argilla/Synth-APIGen-v0.1).
41
+
42
+ ### How to use
43
+
44
+ ```bash
45
+ pip install transformers
46
+ ```
47
+
48
+ #### Running the model on CPU/GPU/multi GPU
49
+ * _Using full precision_
50
+ ```python
51
+ # pip install transformers
52
+ from transformers import AutoModelForCausalLM, AutoTokenizer
53
+ checkpoint = "HuggingFaceTB/SmolLM2-1.7B"
54
+ device = "cuda" # for GPU usage or "cpu" for CPU usage
55
+ tokenizer = AutoTokenizer.from_pretrained(checkpoint)
56
+ # for multiple GPUs install accelerate and do `model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto")`
57
+ model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
58
+ inputs = tokenizer.encode("Gravity is", return_tensors="pt").to(device)
59
+ outputs = model.generate(inputs)
60
+ print(tokenizer.decode(outputs[0]))
61
+ ```
62
+
63
+ * _Using `torch.bfloat16`_
64
+ ```python
65
+ # pip install accelerate
66
+ # for fp16 use `torch_dtype=torch.float16` instead
67
+ model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto", torch_dtype=torch.bfloat16)
68
+ inputs = tokenizer.encode("Gravity is", return_tensors="pt").to("cuda")
69
+ outputs = model.generate(inputs)
70
+ print(tokenizer.decode(outputs[0]))
71
+ ```
72
+ ```bash
73
+ >>> print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
74
+ Memory footprint: 3422.76 MB
75
+ ```
76
+
77
+ ## Evaluation
78
+
79
+ In this section, we report the evaluation results of SmolLM2. All evaluations are zero-shot unless stated otherwise, and we use [lighteval](https://github.com/huggingface/lighteval) to run them.
80
+
81
+ ## Base Pre-Trained Model
82
+
83
+ | Metric | SmolLM2-1.7B | Llama-1B | Qwen2.5-1.5B | SmolLM1-1.7B |
84
+ |------------------|--------------|-------------|---------------|--------------|
85
+ | HellaSwag | **68.7** | 61.2 | 66.4 | 62.9 |
86
+ | ARC (Average) | **60.5** | 49.2 | 58.5 | 59.9 |
87
+ | PIQA | **77.6** | 74.8 | 76.1 | 76.0 |
88
+ | MMLU-Pro (MCF) | **19.4** | 11.7 | 13.7 | 10.8 |
89
+ | CommonsenseQA | **43.6** | 41.2 | 34.1 | 38.0 |
90
+ | TriviaQA | **36.7** | 28.1 | 20.9 | 22.5 |
91
+ | Winogrande | **59.4** | 57.8 | 59.3 | 54.7 |
92
+ | OpenBookQA | 42.2 | 38.4 | 40.0 | **42.4** |
93
+ | GSM8K (5-shot) | 31.0 | 7.2 | **61.3** | 5.5 |
94
+
95
+ ## Instruction Model
96
+
97
+ | Metric | SmolLM2-1.7B-Instruct | Llama-1B-Instruct | Qwen2.5-1.5B-Instruct | SmolLM1-1.7B-Instruct |
98
+ |:-----------------------------|:---------------------:|:-----------------:|:----------------------:|:----------------------:|
99
+ | IFEval (Average prompt/inst) | **56.7** | 53.5 | 47.4 | 23.1 |
100
+ | MT-Bench | 6.13 | 5.48 | **6.52** | 4.33 |
101
+ | OpenRewrite-Eval (micro_avg RougeL) | 44.9 | 39.2 | **46.9** | NaN |
102
+ | HellaSwag | **66.1** | 56.1 | 60.9 | 55.5 |
103
+ | ARC (Average) | **51.7** | 41.6 | 46.2 | 43.7 |
104
+ | PIQA | **74.4** | 72.3 | 73.2 | 71.6 |
105
+ | MMLU-Pro (MCF) | 19.3 | 12.7 | **24.2** | 11.7 |
106
+ | BBH (3-shot) | 32.2 | 27.6 | **35.3** | 25.7 |
107
+ | GSM8K (5-shot) | **48.2** | 26.8 | 42.8 | 4.62 |
108
+
109
+
110
+ ## Limitations
111
+
112
+ SmolLM2 models primarily understand and generate content in English. They can produce text on a variety of topics, but the generated content may not always be factually accurate, logically consistent, or free from biases present in the training data. These models should be used as assistive tools rather than definitive sources of information. Users should always verify important information and critically evaluate any generated content.
113
+
114
+ ## Training
115
+
116
+ ### Model
117
+
118
+ - **Architecture:** Transformer decoder
119
+ - **Pretraining tokens:** 11T
120
+ - **Precision:** bfloat16
121
+
122
+ ### Hardware
123
+
124
+ - **GPUs:** 256 H100
125
+
126
+ ### Software
127
+
128
+ - **Training Framework:** [nanotron](https://github.com/huggingface/nanotron/tree/main)
129
+
130
+ ## License
131
+
132
+ [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
133
+
134
+ ## Citation
135
+ ```bash
136
+ @misc{allal2024SmolLM2,
137
+ title={SmolLM2 - with great data, comes great performance},
138
+ author={Loubna Ben Allal and Anton Lozhkov and Elie Bakouch and Gabriel Martín Blázquez and Lewis Tunstall and Agustín Piqueres and Andres Marafioti and Cyril Zakka and Leandro von Werra and Thomas Wolf},
139
+ year={2024},
140
+ }
141
+ ```