Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Ensure all relevant allennlp submodules are imported with import_plugins() #5246

Merged
merged 6 commits into from
Jun 7, 2021

Conversation

epwalsh
Copy link
Member

@epwalsh epwalsh commented Jun 7, 2021

I was wondering why "bias_mitigator_applicator" wasn't showing up as a registered model name. This fixes that.

@epwalsh epwalsh changed the title Make allennlp is a default plugin itself to ensure all submodules are imported Make allennlp a default plugin itself to ensure all submodules are imported Jun 7, 2021
@@ -22,8 +22,7 @@
from allennlp.common.file_utils import cached_path
from allennlp.models.archival import CONFIG_NAME

logger = logging.getLogger()
logger.setLevel(logging.ERROR)
Copy link
Member Author

Choose a reason for hiding this comment

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

This was messing with the global log level.

@epwalsh epwalsh changed the title Make allennlp a default plugin itself to ensure all submodules are imported Ensure all relevant allennlp submodules are imported with import_plugins() Jun 7, 2021
"""
Import all submodules under the given package.
Primarily useful so that people using AllenNLP as a library
can specify their own custom packages and have their custom
classes get loaded and registered.
"""
if exclude and package_name in exclude:
Copy link
Member

Choose a reason for hiding this comment

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

Looks like exclude should be a Optional[Set[str]]?

@epwalsh epwalsh enabled auto-merge (squash) June 7, 2021 21:25
@epwalsh epwalsh merged commit 8db45e8 into main Jun 7, 2021
@epwalsh epwalsh deleted the plugins-fix branch June 7, 2021 21:55
Abhishek-P pushed a commit to Abhishek-P/allennlp that referenced this pull request Aug 11, 2021
…gins()` (allenai#5246)

* ensure allennlp is a default plugin

* fix logging issue

* fixes

* actually fix
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants