depccg icon indicating copy to clipboard operation
depccg copied to clipboard

Incompatible with AllenNLP >= 1.0

Open niklaskorz opened this issue 3 years ago • 1 comments

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 avatar Mar 17 '21 13:03 niklaskorz

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.

niklaskorz avatar Mar 17 '21 14:03 niklaskorz