Skip to content

plugins

[ allennlp.common.plugins ]


Plugin management.

AllenNLP supports loading "plugins" dynamically. A plugin is just a Python package that can be found and imported by AllenNLP. This is done by creating a file named .allennlp_plugins in the directory where the allennlp command is run that lists the modules that should be loaded, one per line.

DEFAULT_PLUGINS#

DEFAULT_PLUGINS = ("allennlp_models",)

discover_file_plugins#

def discover_file_plugins(
    plugins_filename: str = ".allennlp_plugins"
) -> Iterable[str]

Returns an iterable of the plugins found, declared within a file whose path is plugins_filename.

discover_plugins#

def discover_plugins() -> Iterable[str]

Returns an iterable of the plugins found.

import_plugins#

def import_plugins() -> None

Imports the plugins found with discover_plugins().