Skip to content

Conversation

@mart-r
Copy link
Collaborator

@mart-r mart-r commented Jan 15, 2026

Base models (for the sake of the den at least) are ones for which we do not have a parent model. That is because there may be (and generally is) multiple steps (e.g model creation, self-supervised training, supervised training) to creating a base model. And we do not want to provide models half-way through this process.

The previous logic relied on the model history having something more than 1 hash, but that does not work with the exepcted logic.

This PR fixes the issue by:

  • Setting the ModelInfo.base_model to None in the LocalFileDen implementation upon push if/when the model does not have a parent available.
  • Adds a test (that would previously fail - I checked)

Base models (for the sake of the den at least) are ones for which we do not have a parent model. That is because there may be (and generally is) multiple steps (e.g model creation, self-supervised training, supervised training) to creating a base model. And we do not want to provide models half-way through this process. The previous logic relied on the model history having something more than 1 hash, but that does not work with the exepcted logic
@tomolopolis
Copy link
Member

Copy link
Member

@tomolopolis tomolopolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

def has_model(self, model_info: ModelInfo) -> bool:
# TODO: improve! Is there an API endpoint to call?
for model in self.list_available_base_models():
if model.model_id == model_info.model_id:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return model.model_id == model_info.model_id

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would only check against the first model in the list. And if that doesn't match, it'd return False. The matching model may still be further down the list.

@mart-r mart-r merged commit 5cd5c7d into main Jan 16, 2026
10 checks passed
@mart-r mart-r deleted the bug/medcat-den/CU-869btgwzz-fix-base-model-identification branch January 16, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants