Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with AllenNLP >= 1.0 #17

Open
niklaskorz opened this issue Mar 17, 2021 · 1 comment
Open

Incompatible with AllenNLP >= 1.0 #17

niklaskorz opened this issue Mar 17, 2021 · 1 comment

Comments

@niklaskorz
Copy link

The current my_allennlp implementation tries to access variables that have been removed after version 0.9, e.g. DEFAULT_PREDICTORS.
The current version of AllenNLP is 2.1.0.
I have tried installing 0.9.0 instead, but this seems to fail on my system with Python 3.8.
I can install AllenNLP 1.5.0 and 2.1.0 just fine.

@niklaskorz
Copy link
Author

niklaskorz commented Mar 17, 2021

At least for allennlp 1.5.0, the fix seems to be quite easy:
Instead of accessing the former global DEFAULT_PREDICTORS in my_allennlp/predictor/supertagger_predictor.py, a property default_predictor has to be defined in my_allennlp/models/supertagger.py as part of the class:

@Model.register("supertagger")
class Supertagger(Model):
    default_predictor = "supertagger-predictor"
    ...

I haven't tried whether this also works with 2.1.0 yet.

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

No branches or pull requests

1 participant