File size: 17,430 Bytes
dca2e4e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3f16b59
bd33ed6
 
 
 
 
 
3f16b59
bd33ed6
dca2e4e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
import gradio as gr
import os

def create_app():
    # Custom CSS for better styling
    custom_css = """
    /* Global font size increase */
    .gradio-container, .gradio-container * {
        font-size: 16px !important;
    }
    
    .main-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 20px;
        font-size: 16px;
    }
    .banner-container {
        text-align: center;
        margin-bottom: 30px;
    }
    .section-header {
        background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 15px;
        border-radius: 10px;
        margin: 20px 0 10px 0;
        font-weight: bold;
        font-size: 1.4em !important;
    }
    .subsection-header {
        background: #f8f9fa;
        padding: 10px;
        border-left: 4px solid #667eea;
        margin: 15px 0 10px 0;
        font-weight: bold;
        font-size: 1.1em !important;
    }
    .info-box {
        background: #ffffff;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        padding: 15px;
        margin: 10px 0;
        font-size: 16px !important;
    }
    .info-box p, .info-box li, .info-box ul {
        font-size: 16px !important;
        line-height: 1.6 !important;
    }
    .highlight {
        background: #fff3cd;
        border: 1px solid #ffeaa7;
        border-radius: 5px;
        padding: 10px;
        margin: 5px 0;
        font-size: 16px !important;
    }
    .dataset-link {
        color: #667eea;
        text-decoration: none;
        font-weight: 500;
        font-size: 16px !important;
    }
    .dataset-link:hover {
        text-decoration: underline;
    }
    .checkbox-yes {
        color: #28a745;
        font-weight: bold;
        font-size: 16px !important;
    }
    .checkbox-no {
        color: #dc3545;
        font-weight: bold;
        font-size: 16px !important;
    }
    /* Ensure all text elements have larger font */
    h1, h2, h3, h4, h5, h6 {
        font-size: 1.2em !important;
    }
    strong {
        font-size: inherit !important;
    }
    """

    with gr.Blocks(css=custom_css, title="SmolLM3-3B EU Data Transparency") as app:
        # Banner section with images
        with gr.Row():
            with gr.Column(scale=2):
                try:
                    gr.Image("eu_flag.png", height=180, show_label=False, show_download_button=False, interactive=False, container=False)
                except:
                    gr.HTML('<div style="height: 120px;"></div>')  # Placeholder if image not found
            
            with gr.Column(scale=1.5):
                gr.HTML("""
                <div style="text-align: center; padding: 20px;">
                    <h1 style="color: #2c3e50; margin: 0; font-size: 3em !important;">SmolLM3-3B</h1>
                    <h2 style="color: #667eea; margin: 10px 0 0 0; font-size: 1.5em !important;">Public Summary of Training Content</h2>
                </div>
                """)
            
            with gr.Column(scale=2):
                try:
                    gr.Image("banner.png", height=180, show_label=False, show_download_button=False, interactive=False, container=False)
                except:
                    gr.HTML('<div style="height: 120px;"></div>')  # Placeholder if image not found

        gr.HTML("""
            <div style="text-align: center; margin-top: 40px; padding: 20px; background: #f8f9fa; border-radius: 10px;">
                <p style="color: #6c757d; margin: 0;">
                    This Space contains the transparency report for the <a href="https://huggingface.co/HuggingFaceTB/SmolLM3-3B">SmolLM3-3B</a> GPAI model developped by <a href="https://huggingface.co/">Hugging Face</a> following the guidelines provided by the AI Office.<br/>
                    For more information, see the <a href="https://digital-strategy.ec.europa.eu/en/library/explanatory-notice-and-template-public-summary-training-content-general-purpose-ai-models" class="dataset-link">Explanatory Notice and Template</a>
                </p>
            </div>
        """)
        
        with gr.Column(elem_classes=["main-container"]):
            # Section 1: General Information
            gr.HTML('<div class="section-header">1. General information</div>')
            
            with gr.Row():
                with gr.Column():
                    gr.HTML("""
                    <div class="info-box">
                        <div class="subsection-header">1.1. Provider identification</div>
                        <ul>
                            <li><strong>Provider name and contact details:</strong>
                                <ul>
                                    <li><strong>Hugging Face</strong></li>
                                    <li><strong>Website: <a href="https://huggingface.co" class="dataset-link">https://huggingface.co</a></strong></li>
                                </ul>
                            </li>
                        </ul>
                    </div>
                    """)

                with gr.Column():
                    gr.HTML("""
                    <div class="info-box">
                        <div class="subsection-header">1.2. Model identification</div>
                        <ul>
                            <li><strong>Versioned model name(s):</strong>
                                <ul><li><strong>SmolLM3-3B</strong></li></ul>
                            </li>
                            <li><strong>Model dependencies:</strong>
                                <ul><li><strong>None</strong></li></ul>
                            </li>
                        </ul>
                    </div>
                    """)

            gr.HTML("""
            <div class="info-box">
                <div class="subsection-header">1.3. Modalities, overall training data size and other characteristics</div>
                <ul>
                    <li><strong>TEXT</strong>
                        <ul>
                            <li><strong>Size:</strong> <strong>more than 10 trillion tokens</strong></li>
                            <li>The training corpus for SmolLM3 is made up of several publicly accessible large datasets containing web documents, scientific articles, software code, and synthetically generated textbooks and mathematical data for pre-training in addition to several mid-training and fine-tuning datasets to enable chat interactions, instruction-following and task-solving behaviors.</li>
                        </ul>
                    </li>
                    <li><strong>Latest date of data acquisition/collection for model training:</strong>
                        <ul>
                            <li>The training dataset is made up of different subsets with different publication and cutoff dates. For pre-training, the earliest dataset was last updated on 4/3/2024 (Stack v2), and the latest on 2/19/2025 (FineWeb2-HQ)</li>
                        </ul>
                    </li>
                    <li><strong>Description of the linguistic characteristics of the overall training data:</strong>
                        <ul>
                            <li>The overall training process focuses on 6 languages that are all Union languages: English, French, Spanish, German, Italian, and Portuguese. In addition, pre-training intentionally included smaller quantities of data in Mandarin Chinese, Russian, Persian, Japanese, Korean, Vietnamese, Hindi, Thai, and Greek. Other languages may have been included due to the limitations of automatic language identification in filtering stages.</li>
                        </ul>
                    </li>
                    <li><strong>Other relevant characteristics of the overall training data:</strong>
                        <ul>
                            <li>The training data also includes software code in the programming languages included in the Stack v2 dataset (16 languages including C, Python, Java, Markdown, HTML, Shell, etc.).</li>
                        </ul>
                    </li>
                </ul>
            </div>
            """)

            # Section 2: Data Sources
            gr.HTML('<div class="section-header">2. List of data sources</div>')

            gr.HTML("""
            <div class="info-box">
                <div class="subsection-header">2.1. Publicly available datasets</div>
                <ul>
                    <li><strong>Have you used publicly available datasets to train the model?</strong>
                        <ul><li><strong><span class="checkbox-yes">β˜‘ Yes</span></strong></li></ul>
                    </li>
                    <li><strong>If yes, specify the modality(ies) of the content covered by the datasets concerned:</strong>
                        <ul><li><strong><span class="checkbox-yes">β˜‘ Text</span></strong></li></ul>
                    </li>
                    <li><strong>List of large publicly available datasets:</strong>
                        <ul>
                            <li>DCLM: <a href="https://hf.co/datasets/mlfoundations/dclm-baseline-1.0" class="dataset-link">https://hf.co/datasets/mlfoundations/dclm-baseline-1.0</a></li>
                            <li>FineWeb-Edu: <a href="https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu" class="dataset-link">https://hf.co/datasets/HuggingFaceFW/fineweb-edu</a></li>
                            <li>FineWeb2: <a href="https://huggingface.co/datasets/epfml/FineWeb2-HQ" class="dataset-link">https://hf.co/datasets/epfml/FineWeb2-HQ</a></li>
                            <li>Stack V2: <a href="https://hf.co/datasets/bigcode/the-stack-v2" class="dataset-link">https://hf.co/datasets/bigcode/the-stack-v2</a></li>
                            <li>pes2o: <a href="https://hf.co/datasets/allenai/peS2o" class="dataset-link">https://hf.co/datasets/allenai/peS2o</a></li>
                            <li>SmolTalk2: <a href="https://huggingface.co/datasets/HuggingFaceTB/smoltalk2" class="dataset-link">https://hf.co/datasets/HuggingFaceTB/smoltalk2</a></li>
                        </ul>
                    </li>
                    <li><strong>General description of other publicly available datasets not listed above:</strong>
                        <ul>
                            <li>In addition to the large datasets cited above, many additional publicly available datasets were added to target specific domains, including several math datasets made up of both web-filtered and synthetic data, Wikipedia data, "reasoning data" generated by selected large models on diverse problems, Jupyter notebooks for code, and synthetically generated textbooks; all in English language or software code. The full list of pre-training datasets is available at the following URL: <a href="https://hf.co/collections/HuggingFaceTB/smollm3-pretraining-datasets-685a7353fdc01aecde51b1d9" class="dataset-link">https://hf.co/collections/HuggingFaceTB/smollm3-pretraining-datasets-685a7353fdc01aecde51b1d9</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
            """)

            gr.HTML("""
            <div class="info-box">
                <div class="subsection-header">2.2. Private non-publicly available datasets obtained from third parties</div>
                
                <h4>2.2.1. Datasets commercially licensed by rightsholders or their representatives</h4>
                <ul>
                    <li><strong>Have you concluded transactional commercial licensing agreement(s) with rightsholder(s) or with their representatives?</strong>
                        <ul><li><strong><span class="checkbox-no">☐ No</span></strong></li></ul>
                    </li>
                </ul>
                
                <h4>2.2.2. Private datasets obtained from other third parties</h4>
                <ul>
                    <li><strong>Have you obtained private datasets from third parties that are not licensed as described in Section 2.2.1, such as data obtained from providers of private databases, or data intermediaries?</strong>
                        <ul><li><strong><span class="checkbox-no">☐ No</span></strong></li></ul>
                    </li>
                </ul>
            </div>
            """)

            with gr.Row():
                with gr.Column():
                    gr.HTML("""
                    <div class="info-box">
                        <div class="subsection-header">2.3. Data crawled and scraped from online sources</div>
                        <ul>
                            <li><strong>Were crawlers used by the provider or on behalf of?</strong>
                                <ul><li><strong><span class="checkbox-no">☐ No</span></strong></li></ul>
                            </li>
                        </ul>
                    </div>
                    """)
                
                with gr.Column():
                    gr.HTML("""
                    <div class="info-box">
                        <div class="subsection-header">2.4. User data</div>
                        <ul>
                            <li><strong>Was data from user interactions with the AI model (e.g. user input and prompts) used to train the model?</strong>
                                <ul><li><strong><span class="checkbox-no">☐ No</span></strong></li></ul>
                            </li>
                            <li><strong>Was data collected from user interactions with the provider's other services or products used to train the model?</strong>
                                <ul><li><strong><span class="checkbox-no">☐ No</span></strong></li></ul>
                            </li>
                        </ul>
                    </div>
                    """)

            with gr.Row():
                with gr.Column():
                    gr.HTML("""
                    <div class="info-box">
                        <div class="subsection-header">2.5. Synthetic data</div>
                        <ul>
                            <li><strong>Was synthetic AI-generated data created by the provider or on their behalf to train the model?</strong>
                                <ul><li><strong><span class="checkbox-no">☐ No</span></strong></li></ul>
                            </li>
                        </ul>
                    </div>
                    """)
                
                with gr.Column():
                    gr.HTML("""
                    <div class="info-box">
                        <div class="subsection-header">2.6. Other sources of data</div>
                        <ul>
                            <li><strong>Have data sources other than those described in Sections 2.1 to 2.5 been used to train the model?</strong>
                                <ul><li><strong><span class="checkbox-no">☐ No</span></strong></li></ul>
                            </li>
                        </ul>
                    </div>
                    """)

            # Section 3: Data Processing
            gr.HTML('<div class="section-header">3. Data processing aspects</div>')

            gr.HTML("""
            <div class="info-box">
                <div class="subsection-header">3.1. Respect of reservation of rights from text and data mining exception or limitation</div>
                <ul>
                    <li><strong>Describe the measures implemented before model training to respect reservations of rights from the TDM exception or limitation before and during data collection, including the opt-out protocols and solutions honoured by the provider or, as applicable, by third parties from which datasets have been obtained:</strong>
                        <ul>
                            <li>The training corpus for SmolLM3-3B is made up of diverse pre-existing public datasets maintained by various organizations who still have their own approach to managing the TDM exception. All crawl-based data in the datasets uses the CommonCrawl archives which comply with robots.txt. Some datasets such as the Stack v2 additionally offer general opt-out mechanisms. For each dataset, the latest publicly available version was used to ensure propagation of any rights reservation expressed to the dataset custodian.</li>
                        </ul>
                    </li>
                </ul>
            </div>
            """)

            gr.HTML("""
            <div class="info-box">
                <div class="subsection-header">3.2. Removal of illegal content</div>
                <ul>
                    <li><strong>General description of measures taken:</strong>
                        <ul>
                            <li>Each of the component datasets leveraged is the product of a distinct curation effort by its custodians to select the most desirable content. The specific approaches can typically be found in the dataset documentation. Among other factors, most of the datasets take the approach of using classifiers to identify "highly educational" samples that lowers the likelihood of illegal content.</li>
                        </ul>
                    </li>
                </ul>
            </div>
            """)


    return app

# Create the demo instance directly for Gradio auto-reload
demo = create_app()

if __name__ == "__main__":
    demo.launch(share=True, show_error=True)