Skip to content
Open
Changes from 1 commit
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
Next Next commit
[Jobs] Split script path on both separators for default Job name
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
  • Loading branch information
Wauplin and claude committed Nov 19, 2026
commit 4e44869b88e8e77ae25611babe10072098bcec9c
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