Spaces:
Running
Running
Stabiliser la mise en page entre les navigateurs
#12
by pbordescnil - opened
- .gitattributes +0 -1
- application_neo4j/download_dumps.py +0 -67
- application_neo4j/requirements.txt +0 -4
- application_neo4j/static/js/browser_compatibility.js +0 -1
- application_neo4j/static/notice/notice.pdf +2 -2
- application_neo4j/static/notice/notice_en.pdf +0 -0
- application_neo4j/templates/expert.html +1 -1
- application_neo4j/templates/index.html +1 -1
- application_neo4j/templates/infos.html +1 -1
- application_neo4j/templates/search.html +1 -1
- application_neo4j/templates/search_dataset.html +1 -1
- application_neo4j/translations.py +5 -5
- start.sh +11 -4
.gitattributes
CHANGED
|
@@ -42,4 +42,3 @@ application_neo4j/static/notice/notice_html/media/image4.png filter=lfs diff=lfs
|
|
| 42 |
application_neo4j/static/notice/notice.docx filter=lfs diff=lfs merge=lfs -text
|
| 43 |
application_neo4j/static/notice/notice.pdf filter=lfs diff=lfs merge=lfs -text
|
| 44 |
opengds/*.jar filter=lfs diff=lfs merge=lfs -text
|
| 45 |
-
application_neo4j/static/notice/notice_en.pdf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 42 |
application_neo4j/static/notice/notice.docx filter=lfs diff=lfs merge=lfs -text
|
| 43 |
application_neo4j/static/notice/notice.pdf filter=lfs diff=lfs merge=lfs -text
|
| 44 |
opengds/*.jar filter=lfs diff=lfs merge=lfs -text
|
|
|
application_neo4j/download_dumps.py
DELETED
|
@@ -1,67 +0,0 @@
|
|
| 1 |
-
"""Download the Neo4j dump files from the Hub dataset into /backups.
|
| 2 |
-
|
| 3 |
-
The weekly refresh Job publishes ``neo4j.dump``, ``system.dump`` and
|
| 4 |
-
``database_metadata.json`` into the dataset ``cnil/genmod-dump-neo4j``. The
|
| 5 |
-
dumps are large files stored with Git LFS / XET, so resolving them follows a
|
| 6 |
-
chain of Hugging Face signed redirects that ends on an S3 presigned URL.
|
| 7 |
-
``huggingface_hub`` handles that redirect chain, authentication for the private
|
| 8 |
-
dataset, and retries; a plain ``wget`` does not (it aborts with a ``400`` on
|
| 9 |
-
the S3 presigned URL).
|
| 10 |
-
"""
|
| 11 |
-
|
| 12 |
-
from __future__ import annotations
|
| 13 |
-
|
| 14 |
-
import os
|
| 15 |
-
import sys
|
| 16 |
-
import time
|
| 17 |
-
|
| 18 |
-
from huggingface_hub import hf_hub_download
|
| 19 |
-
|
| 20 |
-
REPO_ID = os.getenv("GENMOD_DUMP_REPO", "cnil/genmod-dump-neo4j")
|
| 21 |
-
REVISION = os.getenv("GENMOD_DUMP_REVISION", "main")
|
| 22 |
-
TOKEN = os.getenv("HF_TOKEN") or None
|
| 23 |
-
DEST_DIR = "/backups"
|
| 24 |
-
MAX_ATTEMPTS = 3
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
def log(message: str) -> None:
|
| 28 |
-
print(f"[genmod-download] {message}", flush=True)
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
def fetch(filename: str, required: bool = True) -> bool:
|
| 32 |
-
for attempt in range(1, MAX_ATTEMPTS + 1):
|
| 33 |
-
try:
|
| 34 |
-
path = hf_hub_download(
|
| 35 |
-
repo_id=REPO_ID,
|
| 36 |
-
repo_type="dataset",
|
| 37 |
-
revision=REVISION,
|
| 38 |
-
filename=filename,
|
| 39 |
-
token=TOKEN,
|
| 40 |
-
local_dir=DEST_DIR,
|
| 41 |
-
)
|
| 42 |
-
log(f"{filename} -> {path} (attempt {attempt})")
|
| 43 |
-
return True
|
| 44 |
-
except Exception as error:
|
| 45 |
-
log(f"{filename} attempt {attempt}/{MAX_ATTEMPTS} failed: {error}")
|
| 46 |
-
if attempt < MAX_ATTEMPTS:
|
| 47 |
-
time.sleep(2 * attempt)
|
| 48 |
-
if required:
|
| 49 |
-
return False
|
| 50 |
-
log(f"{filename} is optional; continuing without it")
|
| 51 |
-
return True
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
def main() -> int:
|
| 55 |
-
os.makedirs(DEST_DIR, exist_ok=True)
|
| 56 |
-
log(f"Downloading dumps from {REPO_ID}@{REVISION}")
|
| 57 |
-
for filename in ("system.dump", "neo4j.dump"):
|
| 58 |
-
if not fetch(filename, required=True):
|
| 59 |
-
log(f"FATAL: could not download {filename}")
|
| 60 |
-
return 1
|
| 61 |
-
fetch("database_metadata.json", required=False)
|
| 62 |
-
log("All dump files are ready")
|
| 63 |
-
return 0
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
if __name__ == "__main__":
|
| 67 |
-
sys.exit(main())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
application_neo4j/requirements.txt
CHANGED
|
@@ -3,7 +3,3 @@ neo4j==5.28.1
|
|
| 3 |
graphdatascience==1.15.1
|
| 4 |
pandas==2.2.3
|
| 5 |
Jinja2 ==3.1.6
|
| 6 |
-
# Bootstrap only: fetch the Neo4j dump from the Hub dataset at container start.
|
| 7 |
-
# Pinned to the latest release that still supports Python 3.9 (the neo4j image);
|
| 8 |
-
# huggingface_hub >= 1.9 requires Python >= 3.10.
|
| 9 |
-
huggingface_hub==1.8.0
|
|
|
|
| 3 |
graphdatascience==1.15.1
|
| 4 |
pandas==2.2.3
|
| 5 |
Jinja2 ==3.1.6
|
|
|
|
|
|
|
|
|
|
|
|
application_neo4j/static/js/browser_compatibility.js
CHANGED
|
@@ -7,7 +7,6 @@
|
|
| 7 |
if (document.documentMode) {
|
| 8 |
var warning = document.getElementById("legacy-browser-warning");
|
| 9 |
if (warning) {
|
| 10 |
-
warning.hidden = false;
|
| 11 |
warning.style.display = "block";
|
| 12 |
}
|
| 13 |
}
|
|
|
|
| 7 |
if (document.documentMode) {
|
| 8 |
var warning = document.getElementById("legacy-browser-warning");
|
| 9 |
if (warning) {
|
|
|
|
| 10 |
warning.style.display = "block";
|
| 11 |
}
|
| 12 |
}
|
application_neo4j/static/notice/notice.pdf
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dced59e9dc43bd1823fd18cee4005415e375e9f77c7a58bc6ffcf3a48e732a3c
|
| 3 |
+
size 409000
|
application_neo4j/static/notice/notice_en.pdf
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
application_neo4j/templates/expert.html
CHANGED
|
@@ -18,7 +18,7 @@
|
|
| 18 |
</head>
|
| 19 |
|
| 20 |
<body class="d-flex flex-column min-vh-100">
|
| 21 |
-
<div id="legacy-browser-warning" class="legacy-browser-warning" role="alert"
|
| 22 |
<script src="{{ url_for('static', filename='js/browser_compatibility.js') }}"></script>
|
| 23 |
<header class="navbar navbar-expand-lg navbar-light bg-light border-bottom">
|
| 24 |
<div class="container">
|
|
|
|
| 18 |
</head>
|
| 19 |
|
| 20 |
<body class="d-flex flex-column min-vh-100">
|
| 21 |
+
<div id="legacy-browser-warning" class="legacy-browser-warning" role="alert">{{ t('site.legacy_browser_warning') }}</div>
|
| 22 |
<script src="{{ url_for('static', filename='js/browser_compatibility.js') }}"></script>
|
| 23 |
<header class="navbar navbar-expand-lg navbar-light bg-light border-bottom">
|
| 24 |
<div class="container">
|
application_neo4j/templates/index.html
CHANGED
|
@@ -138,7 +138,7 @@
|
|
| 138 |
</head>
|
| 139 |
|
| 140 |
<body>
|
| 141 |
-
<div id="legacy-browser-warning" class="legacy-browser-warning" role="alert"
|
| 142 |
<script src="{{ url_for('static', filename='js/browser_compatibility.js') }}"></script>
|
| 143 |
<!-- Language selector -->
|
| 144 |
<div class="lang-switch">
|
|
|
|
| 138 |
</head>
|
| 139 |
|
| 140 |
<body>
|
| 141 |
+
<div id="legacy-browser-warning" class="legacy-browser-warning" role="alert">{{ t('site.legacy_browser_warning') }}</div>
|
| 142 |
<script src="{{ url_for('static', filename='js/browser_compatibility.js') }}"></script>
|
| 143 |
<!-- Language selector -->
|
| 144 |
<div class="lang-switch">
|
application_neo4j/templates/infos.html
CHANGED
|
@@ -30,7 +30,7 @@
|
|
| 30 |
</style>
|
| 31 |
</head>
|
| 32 |
<body>
|
| 33 |
-
<div id="legacy-browser-warning" class="legacy-browser-warning" role="alert"
|
| 34 |
<script src="{{ url_for('static', filename='js/browser_compatibility.js') }}"></script>
|
| 35 |
<nav class="toolbar" aria-label="{{ t('site.home_button') }}">
|
| 36 |
<a class="home-button" href="{{ url_for('home', lang=current_lang) }}">⌂ {{ t('site.home_button') }}</a>
|
|
|
|
| 30 |
</style>
|
| 31 |
</head>
|
| 32 |
<body>
|
| 33 |
+
<div id="legacy-browser-warning" class="legacy-browser-warning" role="alert">{{ t('site.legacy_browser_warning') }}</div>
|
| 34 |
<script src="{{ url_for('static', filename='js/browser_compatibility.js') }}"></script>
|
| 35 |
<nav class="toolbar" aria-label="{{ t('site.home_button') }}">
|
| 36 |
<a class="home-button" href="{{ url_for('home', lang=current_lang) }}">⌂ {{ t('site.home_button') }}</a>
|
application_neo4j/templates/search.html
CHANGED
|
@@ -33,7 +33,7 @@
|
|
| 33 |
</head>
|
| 34 |
|
| 35 |
<body class="d-flex flex-column min-vh-100">
|
| 36 |
-
<div id="legacy-browser-warning" class="legacy-browser-warning" role="alert"
|
| 37 |
<script src="{{ url_for('static', filename='js/browser_compatibility.js') }}"></script>
|
| 38 |
<header class="navbar navbar-expand-lg navbar-light bg-light border-bottom">
|
| 39 |
<div class="container">
|
|
|
|
| 33 |
</head>
|
| 34 |
|
| 35 |
<body class="d-flex flex-column min-vh-100">
|
| 36 |
+
<div id="legacy-browser-warning" class="legacy-browser-warning" role="alert">{{ t('site.legacy_browser_warning') }}</div>
|
| 37 |
<script src="{{ url_for('static', filename='js/browser_compatibility.js') }}"></script>
|
| 38 |
<header class="navbar navbar-expand-lg navbar-light bg-light border-bottom">
|
| 39 |
<div class="container">
|
application_neo4j/templates/search_dataset.html
CHANGED
|
@@ -33,7 +33,7 @@
|
|
| 33 |
</head>
|
| 34 |
|
| 35 |
<body class="d-flex flex-column min-vh-100">
|
| 36 |
-
<div id="legacy-browser-warning" class="legacy-browser-warning" role="alert"
|
| 37 |
<script src="{{ url_for('static', filename='js/browser_compatibility.js') }}"></script>
|
| 38 |
<header class="navbar navbar-expand-lg navbar-light bg-light border-bottom">
|
| 39 |
<div class="container">
|
|
|
|
| 33 |
</head>
|
| 34 |
|
| 35 |
<body class="d-flex flex-column min-vh-100">
|
| 36 |
+
<div id="legacy-browser-warning" class="legacy-browser-warning" role="alert">{{ t('site.legacy_browser_warning') }}</div>
|
| 37 |
<script src="{{ url_for('static', filename='js/browser_compatibility.js') }}"></script>
|
| 38 |
<header class="navbar navbar-expand-lg navbar-light bg-light border-bottom">
|
| 39 |
<div class="container">
|
application_neo4j/translations.py
CHANGED
|
@@ -77,7 +77,7 @@ TRANSLATIONS = {
|
|
| 77 |
"• aux modèles issus du modèle interrogé et publiés sur HuggingFace<br>"
|
| 78 |
"• aux modèles parents de ce modèle.<br><br>"
|
| 79 |
"(A condition que les liens entre modèles soient déclarés par les utiliateurs sur HuggingFace)",
|
| 80 |
-
"home.find_label": "Vous souhaitez connaître la descendance et l'
|
| 81 |
"home.btn_model": "Un modèle",
|
| 82 |
"home.btn_dataset": "Un dataset",
|
| 83 |
"home.btn_unsure": "Je ne sais pas",
|
|
@@ -86,10 +86,10 @@ TRANSLATIONS = {
|
|
| 86 |
"home.download_date": "Date de téléchargement de la base de données : {date}",
|
| 87 |
"home.notice_title": "Mentions d'information sur les traitements de données à caractère personnel",
|
| 88 |
"home.notice_p1": "Afin d'étudier le développement de la communauté de l'IA open source, et de préparer la possibilité d'exercices de droits des citoyens, le projet vise à étudier la base de données des jeux de données et modèles présents sur la plateforme HuggingFace. Cette base de données permet d'établir un arbre généalogique des modèles.",
|
| 89 |
-
"home.notice_p2": "
|
| 90 |
"home.notice_p3": "Ce projet relève de la mission d'intérêt public dont est investie la CNIL en application du règlement général sur la protection des données et de la loi Informatique et Libertés modifiée (article 8).",
|
| 91 |
"home.notice_p4": "Les données sont publiées à partir de l'espace CNIL sur HuggingFace.",
|
| 92 |
-
"home.notice_p5": "
|
| 93 |
"home.notice_p6": "Vous pouvez accéder et obtenir une copie de vos données, vous opposer au traitement de ces données, les faire rectifier ou effacer. Vous disposez également du droit de limiter le traitement de vos données.",
|
| 94 |
"home.notice_p7": "Vous pouvez exercer vos droits ou poser vos questions sur ce projet en contactant le service IA de la CNIL : <a href=\"mailto:ia@cnil.fr\">ia@cnil.fr</a>.",
|
| 95 |
"home.notice_p8": "Si vous estimez, après nous avoir contactés, que vos droits « Informatique et Libertés » ne sont pas respectés, vous pouvez contacter le DPO de la CNIL ou adresser une réclamation à la CNIL.",
|
|
@@ -100,7 +100,7 @@ TRANSLATIONS = {
|
|
| 100 |
"search.page_lead_dataset": "Explorez la généalogie des modèles et datasets",
|
| 101 |
"search.label_name": "Nom à rechercher",
|
| 102 |
"search.placeholder_model": "Taper le nom du modèle ou l'id de son repo Hugging Face.",
|
| 103 |
-
"search.placeholder_dataset": "Taper le nom du dataset
|
| 104 |
"search.label_filters": "Filtres",
|
| 105 |
"search.filter_model": "Modèle",
|
| 106 |
"search.filter_dataset": "Dataset",
|
|
@@ -197,7 +197,7 @@ TRANSLATIONS = {
|
|
| 197 |
# ── expert.html ──
|
| 198 |
"expert.page_title": "Recherche Experte",
|
| 199 |
"expert.page_lead": "Explorez et filtrez la généalogie des modèles",
|
| 200 |
-
"expert.placeholder": "Taper le nom du modèle
|
| 201 |
"expert.filter_author": "Auteur",
|
| 202 |
"expert.connected_component": "Composante connexe du noeud recherché",
|
| 203 |
"expert.legend_title": "Légendes",
|
|
|
|
| 77 |
"• aux modèles issus du modèle interrogé et publiés sur HuggingFace<br>"
|
| 78 |
"• aux modèles parents de ce modèle.<br><br>"
|
| 79 |
"(A condition que les liens entre modèles soient déclarés par les utiliateurs sur HuggingFace)",
|
| 80 |
+
"home.find_label": "Vous souhaitez connaître la descendance et l'acsendance de ...",
|
| 81 |
"home.btn_model": "Un modèle",
|
| 82 |
"home.btn_dataset": "Un dataset",
|
| 83 |
"home.btn_unsure": "Je ne sais pas",
|
|
|
|
| 86 |
"home.download_date": "Date de téléchargement de la base de données : {date}",
|
| 87 |
"home.notice_title": "Mentions d'information sur les traitements de données à caractère personnel",
|
| 88 |
"home.notice_p1": "Afin d'étudier le développement de la communauté de l'IA open source, et de préparer la possibilité d'exercices de droits des citoyens, le projet vise à étudier la base de données des jeux de données et modèles présents sur la plateforme HuggingFace. Cette base de données permet d'établir un arbre généalogique des modèles.",
|
| 89 |
+
"home.notice_p2": "Les données traitées sont le pseudonyme de l'auteur (quand il apparaît dans les métadonnées), le nom du modèle/jeu de données et plusieurs informations inhérentes à ce modèle/jeu de données telles que la date de publication, la licence utilisée ou encore le nombre de téléchargements.",
|
| 90 |
"home.notice_p3": "Ce projet relève de la mission d'intérêt public dont est investie la CNIL en application du règlement général sur la protection des données et de la loi Informatique et Libertés modifiée (article 8).",
|
| 91 |
"home.notice_p4": "Les données sont publiées à partir de l'espace CNIL sur HuggingFace.",
|
| 92 |
+
"home.notice_p5": "Une première phase d'évaluation de l'utilité de l'outil interviendra après 6 mois de publication. A cette échéance, l'outil pourra être modifié et le projet reconduit.",
|
| 93 |
"home.notice_p6": "Vous pouvez accéder et obtenir une copie de vos données, vous opposer au traitement de ces données, les faire rectifier ou effacer. Vous disposez également du droit de limiter le traitement de vos données.",
|
| 94 |
"home.notice_p7": "Vous pouvez exercer vos droits ou poser vos questions sur ce projet en contactant le service IA de la CNIL : <a href=\"mailto:ia@cnil.fr\">ia@cnil.fr</a>.",
|
| 95 |
"home.notice_p8": "Si vous estimez, après nous avoir contactés, que vos droits « Informatique et Libertés » ne sont pas respectés, vous pouvez contacter le DPO de la CNIL ou adresser une réclamation à la CNIL.",
|
|
|
|
| 100 |
"search.page_lead_dataset": "Explorez la généalogie des modèles et datasets",
|
| 101 |
"search.label_name": "Nom à rechercher",
|
| 102 |
"search.placeholder_model": "Taper le nom du modèle ou l'id de son repo Hugging Face.",
|
| 103 |
+
"search.placeholder_dataset": "Taper le nom du dataset suspecté.",
|
| 104 |
"search.label_filters": "Filtres",
|
| 105 |
"search.filter_model": "Modèle",
|
| 106 |
"search.filter_dataset": "Dataset",
|
|
|
|
| 197 |
# ── expert.html ──
|
| 198 |
"expert.page_title": "Recherche Experte",
|
| 199 |
"expert.page_lead": "Explorez et filtrez la généalogie des modèles",
|
| 200 |
+
"expert.placeholder": "Taper le nom du modèle suspecté.",
|
| 201 |
"expert.filter_author": "Auteur",
|
| 202 |
"expert.connected_component": "Composante connexe du noeud recherché",
|
| 203 |
"expert.legend_title": "Légendes",
|
start.sh
CHANGED
|
@@ -1,11 +1,18 @@
|
|
| 1 |
set -euo pipefail
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
# Load the database backup. Metadata is optional for compatibility with the
|
| 4 |
# original dump; the application then falls back to its historical date.
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
| 9 |
neo4j-admin database load --expand-commands system --from-path=/backups --overwrite-destination=true
|
| 10 |
neo4j-admin database load --expand-commands neo4j --from-path=/backups --overwrite-destination=true
|
| 11 |
|
|
|
|
| 1 |
set -euo pipefail
|
| 2 |
|
| 3 |
+
DUMP_REPO="${GENMOD_DUMP_REPO:-cnil/genmod-dump-neo4j}"
|
| 4 |
+
DUMP_REVISION="${GENMOD_DUMP_REVISION:-main}"
|
| 5 |
+
DUMP_BASE_URL="https://huggingface.co/datasets/${DUMP_REPO}/resolve/${DUMP_REVISION}"
|
| 6 |
+
AUTH_HEADER="Authorization: Bearer ${HF_TOKEN}"
|
| 7 |
+
|
| 8 |
# Load the database backup. Metadata is optional for compatibility with the
|
| 9 |
# original dump; the application then falls back to its historical date.
|
| 10 |
+
wget --header="${AUTH_HEADER}" "${DUMP_BASE_URL}/system.dump" -O /backups/system.dump
|
| 11 |
+
wget --header="${AUTH_HEADER}" "${DUMP_BASE_URL}/neo4j.dump" -O /backups/neo4j.dump
|
| 12 |
+
if ! wget --header="${AUTH_HEADER}" "${DUMP_BASE_URL}/database_metadata.json" \
|
| 13 |
+
-O /backups/database_metadata.json; then
|
| 14 |
+
rm -f /backups/database_metadata.json
|
| 15 |
+
fi
|
| 16 |
neo4j-admin database load --expand-commands system --from-path=/backups --overwrite-destination=true
|
| 17 |
neo4j-admin database load --expand-commands neo4j --from-path=/backups --overwrite-destination=true
|
| 18 |
|