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('
') # Placeholder if image not found
with gr.Column(scale=1.5):
gr.HTML("""
SmolLM3-3B
Public Summary of Training Content
""")
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('') # Placeholder if image not found
gr.HTML("""
This Space contains the transparency report for the SmolLM3-3B GPAI model developed by Hugging Face following the guidelines provided by the AI Office.
It may serve as an example for open-source GPAI trained exclusively on public datasets. For more information, see the Explanatory Notice and Template
π TL;DR
SmolLM3-3B is a state-of-the-art 3-billion parameter language model by Hugging Face trained on 10+ trillion tokens from publicly available datasets including web documents, scientific articles, and code.
Training focused on 6 EU languages plus others. The model uses only public datasets (no commercial licensing, user data, or other private data).
Data processing was done by the original component dataset curators with varied approaches to TDM and filtering that typically include compliance with robots.txt and other opt-out mechanisms, and educational content classifiers.
""")
# Section 1: General Information
gr.HTML('')
gr.HTML("""
TL;DR: Provider: Hugging Face | Model: SmolLM3-3B | Training: 10+ trillion tokens, 6 EU languages + others
""")
with gr.Accordion("π Click for full information", open=False):
with gr.Row():
with gr.Column():
gr.HTML("""
- Provider name and contact details:
- Authorised representative name and contact details:
""")
with gr.Column():
gr.HTML("""
- Versioned model name(s):
- Model dependencies:
""")
gr.HTML("""
- TEXT
- Size: [more than 10 trillion tokens]
- The training corpus is made up of 11 trillion tokens as tokenized by the Llama-3.2-1B tokenizer.
- 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.
- Latest date of data acquisition/collection for model training:
- 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)
- Description of the linguistic characteristics of the overall training data:
- 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.
- Other relevant characteristics of the overall training data:
- 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).
""")
# Section 2: Data Sources
gr.HTML('')
gr.HTML("""
TL;DR: β
Publicly available datasets including synthetic data | β No commercial licensing, crawling, user data, or private data
""")
with gr.Accordion("π Click for full information", open=False):
gr.HTML("""
- Have you used publicly available datasets to train the model?
- If yes, specify the modality(ies) of the content covered by the datasets concerned:
- List of large publicly available datasets:
- General description of other publicly available datasets not listed above:
- 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: https://hf.co/collections/HuggingFaceTB/smollm3-pretraining-datasets-685a7353fdc01aecde51b1d9
""")
gr.HTML("""
2.2.1. Datasets commercially licensed by rightsholders or their representatives
- Have you concluded transactional commercial licensing agreement(s) with rightsholder(s) or with their representatives?
2.2.2. Private datasets obtained from other third parties
- 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?
""")
with gr.Row():
with gr.Column():
gr.HTML("""
- Were crawlers used by the provider or on behalf of?
""")
with gr.Column():
gr.HTML("""
- Was data from user interactions with the AI model (e.g. user input and prompts) used to train the model?
- Was data collected from user interactions with the provider's other services or products used to train the model?
""")
with gr.Row():
with gr.Column():
gr.HTML("""
- Was synthetic AI-generated data created by the provider or on their behalf to train the model?
- If yes, modality of the synthetic data:
- 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:
- Additional comments (optional):
""")
with gr.Column():
gr.HTML("""
- Have data sources other than those described in Sections 2.1 to 2.5 been used to train the model?
""")
# Section 3: Data Processing
gr.HTML('')
gr.HTML("""
TL;DR: TDM rights: robots.txt baseline otherwise dataset-dependent | Content filtering: Dataset-dependent including educational classifiers
""")
with gr.Accordion("π Click for full information", open=False):
gr.HTML("""
- 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:
- 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.
""")
gr.HTML("""
- General description of measures taken:
-
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.
""")
return app
# Create the demo instance directly for Gradio auto-reload
demo = create_app()
if __name__ == "__main__":
demo.launch(share=True, show_error=True)