From a668de417696e4d404b290e4b79449062cd0566a Mon Sep 17 00:00:00 2001 From: Nick Reynolds <7061178+goldnode@users.noreply.github.com> Date: Wed, 1 Oct 2025 14:21:30 +0100 Subject: [PATCH] The error message as previously displayed... "Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are forbidden" did not make sense. This change will display a clear and correct message for the REGEX check being made. --- src/huggingface_hub/utils/_validators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/huggingface_hub/utils/_validators.py b/src/huggingface_hub/utils/_validators.py index 27833f28e3..4bc219611b 100644 --- a/src/huggingface_hub/utils/_validators.py +++ b/src/huggingface_hub/utils/_validators.py @@ -158,8 +158,8 @@ def validate_repo_id(repo_id: str) -> None: if not REPO_ID_REGEX.match(repo_id): raise HFValidationError( - "Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are" - " forbidden, '-' and '.' cannot start or end the name, max length is 96:" + "Repo id must use alphanumeric chars, '-', '_' or '.'." + " The name cannot start or end with '-' or '.' and the maximum length is 96:" f" '{repo_id}'." )