Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/huggingface_hub/_jobs_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ def _default_job_name_from_script(
hash. The CLI passes it so that the name reflects the values actually submitted, including those
coming from a script's `[tool.hf-jobs]` header rather than from the command line.
"""
name = script.split("?", 1)[0].split("#", 1)[0].rstrip("/").split("/")[-1]
name = re.split(r"[\\/]", script.split("?", 1)[0].split("#", 1)[0].rstrip("/\\"))[-1]
if name.endswith(".py"):
name = name[: -len(".py")]
return _default_job_name(name or script, [script, *script_args, *(config_parts or [])])
Expand Down
Loading