master branch of AllenNLP.pip freeze.
Tried all three URLs from the AllenNLP Public Models for the upgrade but none of them passes:
botml/service/serve.py:48: in make_app
return make_app_helper(features, app, available_features)
botml/service/serve.py:56: in make_app_helper
avail_features[feat](app)
botml/service/score_serve_mc.py:23: in add_api_mc
predictor_qa = qa_tables.load_archive_from_model(model_path)
botml/nlp/qa_tables.py:12: in load_archive_from_model
archive = load_archive(model_path)
allennlp/lib/python3.7/site-packages/allennlp/models/archival.py:197: in load_archive
opt_level=opt_level,
allennlp/lib/python3.7/site-packages/allennlp/models/model.py:391: in load
model_class: Type[Model] = cls.by_name(model_type) # type: ignore
allennlp/lib/python3.7/site-packages/allennlp/common/registrable.py:137: in by_name
subclass, constructor = cls.resolve_class_name(name)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'allennlp.models.model.Model'>, name = 'wikitables_erm_parser'
@classmethod
def resolve_class_name(cls: Type[T], name: str) -> Tuple[Type[T], Optional[str]]:
"""
Returns the subclass that corresponds to the given `name`, along with the name of the
method that was registered as a constructor for that `name`, if any.
This method also allows `name` to be a fully-specified module name, instead of a name that
was already added to the `Registry`. In that case, you cannot use a separate function as
a constructor (as you need to call `cls.register()` in order to tell us what separate
function to use).
"""
if name in Registrable._registry[cls]:
subclass, constructor = Registrable._registry[cls].get(name)
return subclass, constructor
elif "." in name:
# This might be a fully qualified class name, so we'll try importing its "module"
# and finding it there.
parts = name.split(".")
submodule = ".".join(parts[:-1])
class_name = parts[-1]
try:
module = importlib.import_module(submodule)
except ModuleNotFoundError:
raise ConfigurationError(
f"tried to interpret {name} as a path to a class "
f"but unable to import module {submodule}"
)
try:
subclass = getattr(module, class_name)
constructor = None
return subclass, constructor
except AttributeError:
raise ConfigurationError(
f"tried to interpret {name} as a path to a class "
f"but unable to find class {class_name} in {submodule}"
)
else:
# is not a qualified class name
raise ConfigurationError(
> f"{name} is not a registered name for {cls.__name__}. "
"You probably need to use the --include-package flag "
"to load your custom code. Alternatively, you can specify your choices "
"""using fully-qualified paths, e.g. {"model": "my_module.models.MyModel"} """
"in which case they will be automatically imported correctly."
)
E allennlp.common.checks.ConfigurationError: wikitables_erm_parser is not a registered name for Model. You probably need to use the --include-package flag to load your custom code. Alternatively, you can specify your choices using fully-qualified paths, e.g. {"model": "my_module.models.MyModel"} in which case they will be automatically imported correctly.
allennlp/lib/python3.7/site-packages/allennlp/common/registrable.py:185: ConfigurationError
OS: Ubuntu 18.04
Python version: 3.7.8
Output of
pip freeze:
Example source:
That model is in the allennlp-semparse repo. You'll need to do pip install allennlp-semparse in order for that to work (though I'm not sure we have an up-to-date release; you may need to clone the repo and run pip install -e . instead...).
You may also have to explicitly import the model, to make sure it gets registered; I'm not sure if the semparse repo is included in our default set of plugins to check for.
You may also have to explicitly import the model, to make sure it gets registered; I'm not sure if the semparse repo is included in our default set of plugins to check for.
Hey @matt-gardner , Thanks for the quick response. pip install allennlp-semparse didn't work so I proceeded with pip install -e after cloning allennlp-semparse inside our repository. Then I built the package using the command python setup.py develop being inside the dir allennlp-semparse, but still I'm unable to import the semparse models explicitly into my codebase. Am I missing something? Also, why is the support for model wikitables_erm_parser removed from v1.0?

Added the following packages from allennlp-semparse and the error is gone! Thanks again @matt-gardner :smile:
That model is in the allennlp-semparse repo. You'll need to do
pip install allennlp-semparsein order for that to work (though I'm not sure we have an up-to-date release; you may need to clone the repo and runpip install -e .instead...).
Hey @matt-gardner , do you guys have any plans to release allennlp-semparse to the pip? if not, how would you suggest we incorporate the same into our codebase?
Yes, we should be releasing this to pypi, we just haven't gotten to it yet. I'll rename and re-open this issue, so we don't forget about it, though it isn't super high priority for us. For now, you can just do pip install git+https://github.com/allenai/allennlp-semparse
@matt-gardner I can take this if you want. I'll ramp up the CI in the semparse repo to match what we've done with allennp-models CI.
Thanks, that'd be great.
allennlp-semparse is now on PyPI:
pip install allennlp-semparse