Skip to content

Fix Import contamination - #196

Merged
LBerth merged 23 commits into
mainfrom
import_contamination
Jul 24, 2026
Merged

Fix Import contamination#196
LBerth merged 23 commits into
mainfrom
import_contamination

Conversation

@LBerth

@LBerth LBerth commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

The build of the registry in mfai.pytorch.models.__init__ is not automatic but simply a function that is called in the tests. Thus, the import of a model (which execute the mfai.pytorch.models.__init__) do not import all other models and librairies required for them.

This update on the construction of the registry, requires to:

  • change the conditions to add the model in the registry (isinstance(kls, type) and issubclass(kls, nn.Module) and kls not in [ModelABC, BaseModel] and hasattr(kls, "model_type"))
  • add a new ModelType to include VitEncoder and VitClassifier

@tourniert
tourniert marked this pull request as ready for review July 24, 2026 13:52
@LBerth LBerth changed the title Import contamination Fix Import contamination Jul 24, 2026
@LBerth
LBerth merged commit 58c0dbf into main Jul 24, 2026
5 checks passed
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