Skip to content

feat(medcat): Allow loading with fewer addons#566

Merged
mart-r merged 5 commits into
mainfrom
feat/medcat/allow-loading-with-fewer-addons
Jun 25, 2026
Merged

feat(medcat): Allow loading with fewer addons#566
mart-r merged 5 commits into
mainfrom
feat/medcat/allow-loading-with-fewer-addons

Conversation

@mart-r

@mart-r mart-r commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

This PR allows loading a subet of addons at model load time.

This should be beneficial in (at least) 2 situations (both in terms of load time and RAM usage):

  1. You've got a model with addons you do not wish to use
  2. You've got a model with addons you cannot use (i.e you don't have the external code required)

PS:
In medcat terms, addons are components that run in addition to the core pipe (NER, linking) and extensions are external projects that may provide core components and addons alike (as long as they register them with the core lib).

loaded = cat.CAT.load_model_pack(self.mpp, keep_addons_of_types=[RelCATAddon])
self.assertFalse(list(enumerate(loaded.pipe.iter_addons())))

def test_filter_meta_cat_loads_meta_cat(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

worth adding an assert to test the correct metacat by name has been preserved?

@tomolopolis tomolopolis left a comment

Copy link
Copy Markdown
Member

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 240765c into main Jun 25, 2026
20 checks passed
@mart-r mart-r deleted the feat/medcat/allow-loading-with-fewer-addons branch June 25, 2026 15:38
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.

2 participants