Spaces:
Sleeping
Timestamp every revision entry, and say "latest" not "dernier"
Browse filesThe main entry read "main (dernier)" with no date while the commit rows
carried one, so the option that actually tracks the tip was the only one you
could not date. It now reports the tip commit's timestamp, and the label is
English -- "latest" reads as the ref-that-moves, like a latest tag.
Commit rows were %Y-%m-%d only, which is not enough resolution here: the two
top commits of the MiniLM repo are 2 seconds apart, so a whole training run
was indistinguishable from the one before it. Every row now carries date and
time through a single config.stamp, which the model line under the pickers
uses too -- three timestamps, one format, all UTC.
Labels changed but values did not, so a selected sha survives the refresh.
Empty repo degrades to a bare "main (latest)" with no dangling separator.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Files changed (4)
- README.md+5
- app/config.py+6
- app/hub.py+4-3
- app/text.py+2-2
63 unmodified lines64656667686963 unmodified linesAttention, `last_modified` vaut pour le dépôt entier — une correction deREADME suffit à déplacer le choix par défaut, et la date affichée le montre.Les deux sorties de `train.py` sont acceptées : la présence de `model_head.pkl`sélectionne le chemin SetFit, sinon le modèle est chargé comme un`AutoModelForSequenceClassification`.63 unmodified lines646566676869707172737463 unmodified linesAttention, `last_modified` vaut pour le dépôt entier — une correction deREADME suffit à déplacer le choix par défaut, et la date affichée le montre.Chaque entrée du menu des révisions porte son horodatage, `main (latest)`compris, qui reprend celui du commit de tête — deux entraînements poussés lemême jour restent donc distinguables. Un seul format partout,`%Y-%m-%d %H:%M` en UTC (`config.stamp`).Les deux sorties de `train.py` sont acceptées : la présence de `model_head.pkl`sélectionne le chemin SetFit, sinon le modèle est chargé comme un`AutoModelForSequenceClassification`.
12347 unmodified lines121314import osORG = "bee2link"MODEL_SEARCH = "breakdown-risk-"7 unmodified linesdef display(label: str) -> str:return LABEL_NAMES.get(label, label)123457 unmodified lines1314151617181920import osfrom datetime import datetimeORG = "bee2link"MODEL_SEARCH = "breakdown-risk-"7 unmodified linesdef display(label: str) -> str:return LABEL_NAMES.get(label, label)def stamp(when: datetime) -> str:"""One timestamp format everywhere; the Hub hands us UTC."""return f"{when:%Y-%m-%d %H:%M}"
3 unmodified lines4567891021 unmodified lines32333435363738394041423 unmodified linesfrom huggingface_hub import HfApi, hf_hub_downloadfrom .config import MODEL_SEARCH, ORG, TOKENapi = HfApi(token=TOKEN)21 unmodified linesif not repo:return []commits = api.list_repo_commits(repo, token=TOKEN)return [("main (dernier)", "main"), *(_commit_choice(c) for c in commits)]def _commit_choice(commit) -> tuple[str, str]:label = f"{commit.commit_id[:7]} · {commit.title[:44]} · {commit.created_at:%Y-%m-%d}"return label, commit.commit_id3 unmodified lines4567891021 unmodified lines3233343536373839404142433 unmodified linesfrom huggingface_hub import HfApi, hf_hub_downloadfrom .config import MODEL_SEARCH, ORG, TOKEN, stampapi = HfApi(token=TOKEN)21 unmodified linesif not repo:return []commits = api.list_repo_commits(repo, token=TOKEN)tip = f" · {stamp(commits[0].created_at)}" if commits else ""return [(f"main (latest){tip}", "main"), *(_commit_choice(c) for c in commits)]def _commit_choice(commit) -> tuple[str, str]:label = f"{commit.commit_id[:7]} · {commit.title[:44]} · {stamp(commit.created_at)}"return label, commit.commit_id
12345623 unmodified lines30313233from datetime import datetimefrom .config import CALLER_TURNS, DATASET_REPO, ORGHEADER = f"""# Risque d'immobilisation23 unmodified lines"""Line under the pickers: when the selected repo was last touched."""if when is None:return ""return f"<sub>Dépôt mis à jour le {when:%d/%m/%Y à %H:%M} UTC</sub>"12345623 unmodified lines30313233from datetime import datetimefrom .config import CALLER_TURNS, DATASET_REPO, ORG, stampHEADER = f"""# Risque d'immobilisation23 unmodified lines"""Line under the pickers: when the selected repo was last touched."""if when is None:return ""return f"<sub>Dépôt mis à jour le {stamp(when)} UTC</sub>"