Skip to content

Conversation

@mart-r
Copy link
Collaborator

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

MedCAT-Den uses a a class that wraps the medcat.cat.CAT class (medcat_den.wrappers.CATWrapper). The point of it is to not allow the model to be saved onto disk (under normal circumstances). This is because the idea is to use the wrapped model (that's received from a den) locally and only save it in the back end (hopefully MedCATtery) so that all the changes are kept track of.

However, when the model is in fact saved on disk (e.g for a local version of the den) the models were saved as if they were (exclusively!) of the wrapper type. This mean that things that didn't have access to medcat_den were unable to load these models. For instance, when pushing one of these to the remote MedCATtery, the latter would be unable to load it.

This PR addresses the issue by calling the CAT.save_model_pack explicitly to make sure that the instnace is treated as CAT rather than CATWrapper. A simple test was also added. This would fail in the previous implementation (I checked).

@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

@mart-r mart-r merged commit 15a7451 into main Jan 16, 2026
10 checks passed
@mart-r mart-r deleted the bug/medcat-den/CU-869bu4tum-fix-wrapper-save branch January 16, 2026 16:58
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