Skip to content
Merged
Show file tree
Hide file tree
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: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ to communicate reliably.

- Bug where non-trainable shared model groups were queried for training status when
resbumitting a failed fine-tune job.
- Rearranged trained model name so Hugging Face can always tell from the name what type
of model it is.


## [2.0.0] - 2025-06-16
Expand Down
18 changes: 13 additions & 5 deletions nip/language_model_server/trainer_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,22 @@ def __init__(
undefined=StrictUndefined,
)

time_string = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
sanitised_model_name = self.config.model_name.replace("/", "_")
self.id = f"{sanitised_model_name}_{self.config.method}_{time_string}"
self.repo_name = f"{HF_SELF_HOSTED_FINETUNED_REPO_PREFIX}{self.config.method}"
time_now = datetime.now().replace(microsecond=0)
sanitised_model_name = self.config.model_name.rpartition("/")[2]
self.id = (
f"{sanitised_model_name}"
f"_{self.config.method}"
f"_{time_now.strftime('%Y-%m-%d_%H-%M-%S')}"
)
self.repo_name = (
f"{HF_SELF_HOSTED_FINETUNED_REPO_PREFIX}"
f"{self.config.method}"
f"_{sanitised_model_name}"
)
if self.job_name:
self.id += f"_{self.job_name}"
self.repo_name += f"_{self.job_name}"
self.repo_name += f"_{time_string}_{sanitised_model_name}"
self.repo_name += f"_{time_now.timestamp()}"
self.repo_name = self.repo_name[:96] # Ensure the repo name is within the limit
self.new_model_name = (
f"{get_env_var('HF_SELF_HOSTED_FINETUNE_NAMESPACE')}/{self.repo_name}"
Expand Down