File size: 26,511 Bytes
dca2e4e 4674df5 dca2e4e 4674df5 dca2e4e 4674df5 dca2e4e 4674df5 dca2e4e bd33ed6 dca2e4e fdaa39b dca2e4e fdaa39b 4674df5 fdaa39b dca2e4e fdaa39b 4674df5 fdaa39b 4674df5 23de540 4674df5 fdaa39b dca2e4e fdaa39b dca2e4e fdaa39b dca2e4e fdaa39b 4674df5 fdaa39b 4674df5 fdaa39b 4674df5 fdaa39b 4674df5 fdaa39b dca2e4e fdaa39b 4674df5 dca2e4e fdaa39b 4674df5 fdaa39b dca2e4e fdaa39b dca2e4e fdaa39b dca2e4e fdaa39b 4674df5 fdaa39b dca2e4e fdaa39b dca2e4e fdaa39b dca2e4e fdaa39b 4674df5 fdaa39b 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 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 |
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;
color: #2c3e50;
}
.info-box {
background: #ffffff;
border: 1px solid #e9ecef;
border-radius: 8px;
padding: 15px;
margin: 10px 0;
font-size: 16px !important;
color: #2c3e50;
}
.info-box p, .info-box li, .info-box ul {
font-size: 16px !important;
line-height: 1.6 !important;
color: #2c3e50;
}
.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;
}
/* Dark mode adaptations */
@media (prefers-color-scheme: dark) {
.subsection-header {
background: #2d3748 !important;
color: #e2e8f0 !important;
}
.info-box {
background: #2d3748 !important;
border: 1px solid #4a5568 !important;
color: #e2e8f0 !important;
}
.info-box p, .info-box li, .info-box ul {
color: #e2e8f0 !important;
}
.highlight {
background: #553c9a !important;
border: 1px solid #667eea !important;
color: #e2e8f0 !important;
}
.dataset-link {
color: #90cdf4 !important;
}
.checkbox-yes {
color: #68d391 !important;
}
.checkbox-no {
color: #fc8181 !important;
}
.tldr-box {
background: linear-gradient(90deg, #2a365f 0%, #553c9a 100%) !important;
color: #e2e8f0 !important;
}
.version-box {
background: linear-gradient(90deg, #2a365f 0%, #553c9a 100%) !important;
color: #e2e8f0 !important;
}
}
/* Gradio dark mode detection - alternative approach */
.dark .subsection-header,
[data-theme="dark"] .subsection-header {
background: #2d3748 !important;
color: #e2e8f0 !important;
}
.dark .info-box,
[data-theme="dark"] .info-box {
background: #2d3748 !important;
border: 1px solid #4a5568 !important;
color: #e2e8f0 !important;
}
.dark .info-box p, .dark .info-box li, .dark .info-box ul,
[data-theme="dark"] .info-box p, [data-theme="dark"] .info-box li, [data-theme="dark"] .info-box ul {
color: #e2e8f0 !important;
}
.dark .highlight,
[data-theme="dark"] .highlight {
background: #553c9a !important;
border: 1px solid #667eea !important;
color: #e2e8f0 !important;
}
.dark .dataset-link,
[data-theme="dark"] .dataset-link {
color: #90cdf4 !important;
}
.dark .checkbox-yes,
[data-theme="dark"] .checkbox-yes {
color: #68d391 !important;
}
.dark .checkbox-no,
[data-theme="dark"] .checkbox-no {
color: #fc8181 !important;
}
.dark .tldr-box,
[data-theme="dark"] .tldr-box {
background: linear-gradient(90deg, #2a365f 0%, #553c9a 100%) !important;
color: #e2e8f0 !important;
}
.dark .version-box,
[data-theme="dark"] .version-box {
background: linear-gradient(90deg, #2a365f 0%, #553c9a 100%) !important;
color: #e2e8f0 !important;
}
"""
with gr.Blocks(css=custom_css, title="SmolLM3-3B EU Data Transparency") as app:
with gr.Column(elem_classes=["main-container"]):
# Banner section with images
with gr.Row():
with gr.Column(scale=1):
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: 2.25em !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 class="version-box" style="margin-top: 15px; padding: 8px 16px; background: linear-gradient(90deg, #e3f2fd 0%, #f3e5f5 100%); border-radius: 20px; display: inline-block; font-size: 14px; color: #2c3e50; border-left: 3px solid #667eea;">
<a href="https://huggingface.co/spaces/hfmlsoc/smollm3-eu-data-transparency/commits/main" class="dataset-link" style="font-weight: bold; color: inherit;">Summary v1.0</a> - Last updated: 25/07/2025
</div>
</div>
""")
with gr.Column(scale=1):
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 developed by <a href="https://huggingface.co/">Hugging Face</a> following the guidelines provided by the AI Office.<br/>
It may serve as an example for <strong>open-source GPAI trained exclusively on public datasets</strong>. 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>
<div class="tldr-box" style="margin: 30px 0; padding: 20px; background: linear-gradient(90deg, #e3f2fd 0%, #f3e5f5 100%); border-radius: 10px; border-left: 5px solid #667eea; color: #2c3e50;">
<h3 style="color: inherit; margin-top: 0; font-size: 1.3em !important;"><strong>π TL;DR</strong></h3>
<p style="font-size: 16px !important; line-height: 1.6; margin: 10px 0; color: inherit;"><strong>SmolLM3-3B</strong> is a state-of-the-art 3-billion parameter language model by <strong>Hugging Face</strong> trained on <strong>10+ trillion tokens</strong> from publicly available datasets including web documents, scientific articles, and code.
Training focused on <strong>6 EU languages</strong> plus others. The model uses <strong>only public datasets</strong> (no commercial licensing, user data, or other private data).
Data processing was done by the original component dataset curators with <strong>varied approaches to TDM and filtering</strong> that typically include compliance with robots.txt and other opt-out mechanisms, and educational content classifiers.</p>
</div>
""")
# Section 1: General Information
gr.HTML('<div class="section-header">1. General information</div>')
gr.HTML("""
<div style="padding: 15px; margin: 10px 0; background: #f8f9fa; border-radius: 8px; border-left: 4px solid #667eea;">
<p style="margin: 0; font-size: 16px !important; color: #2c3e50;"><strong>TL;DR:</strong> Provider: Hugging Face | Model: SmolLM3-3B | Training: 10+ trillion tokens, 6 EU languages + others</p>
</div>
""")
with gr.Accordion("π Click for full information", open=False):
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>Hugging Face Inc., <a href="mailto:[email protected]" class="dataset-link">[email protected]</a></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>
<ul><li>The training corpus is made up of 11 trillion tokens as tokenized by the <a href="https://huggingface.co/meta-llama/Llama-3.2-1B" class="dataset-link">Llama-3.2-1B</a> tokenizer.</li></ul>
<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 official EU 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 (also an official EU language). 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, C++, C-Sharp, Python, Java, JavaScript, Markdown, HTML, Shell, PHP, TypeScript, Swift, SQL, Ruby, Go, and Rust).</li>
</ul>
</li>
</ul>
</div>
""")
# Section 2: Data Sources
gr.HTML('<div class="section-header">2. List of data sources</div>')
gr.HTML("""
<div style="padding: 15px; margin: 10px 0; background: #f8f9fa; border-radius: 8px; border-left: 4px solid #667eea;">
<p style="margin: 0; font-size: 16px !important; color: #2c3e50;"><strong>TL;DR:</strong> β
Publicly available datasets including synthetic data | β No commercial licensing, crawling, user data, or private data</p>
</div>
""")
with gr.Accordion("π Click for full information", open=False):
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>FineMath : <a href="https://hf.co/datasets/HuggingFaceTB/finemath" class="dataset-link">https://hf.co/datasets/HuggingFaceTB/finemath</a></li>
<li>MegaMath: <a href="https://hf.co/datasets/LLM360/MegaMath" class="dataset-link">https://hf.co/datasets/LLM360/MegaMath</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-yes">β Yes</span></strong></li></ul>
</li>
<li><strong>If yes, modality of the synthetic data:</strong>
<ul><li><strong><span class="checkbox-yes">β Text</span></strong></li></ul>
</li>
<li><strong>Information about other AI models, including providerβs own AI model(s) not available on the market, used to generate synthetic data to train the model to which this Summary applies:</strong>
<ul><li>Additional data was generated using the <a href="https://huggingface.co/Qwen/Qwen3-32B" class="dataset-link">Qwen3-32B</a> and <a href="https://huggingface.co/Qwen/Qwen3-Embedding-0.6B" class="dataset-link">Qwen3-0.6B</a> open-weight models.</li></ul>
</li>
<li><strong>Additional comments (optional):</strong>
<ul><li>Some parts of the <a href="https://hf.co/datasets/HuggingFaceTB/smoltalk2" class="dataset-link">SmolTalk2</a> dataset mentioned in Section 2.1 were synthetically generated for the purpose of training this model. See <a href="https://huggingface.co/datasets/HuggingFaceTB/smoltalk2#license" class="dataset-link">License information in the dataset description</a>.</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 style="padding: 15px; margin: 10px 0; background: #f8f9fa; border-radius: 8px; border-left: 4px solid #667eea;">
<p style="margin: 0; font-size: 16px !important; color: #2c3e50;"><strong>TL;DR:</strong> TDM rights: robots.txt baseline otherwise dataset-dependent | Content filtering: Dataset-dependent including educational classifiers</p>
</div>
""")
with gr.Accordion("π Click for full information", open=False):
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.
Datasets like The Stack v2 for example additionally filtered out software code with copyleft licenses and applied automatic redaction of categories of personal data.
</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) |