Closed abis330 closed 1 year ago
Thanks for raising an issue, I will try to look into this. Looks like the issue is on the AllenNLP side of things. Unless you really need to use AllenNLP, can you try using it from HuggingFace Transformers instead? Instructions here.
I am planning to do pre-training on the unlabeled dataset that I have with me. This error is stopping me to do so.
TLDR; You likely have installed an unsupported version of AllenNLP. Try installing a supported version and running the code again.
Can you provide more information on your environment, please? E.g. OS, python version, AllenNLP version, the commands you used to install DeCLUTR, etc...
This works fine in the embedding.ipynb notebook (see screenshot below)
so I think it's likely there is something up with your environment. Looking at the error, my best guess is that you have installed a newer version of AllenNLP than is supported by this repo. In the version of AllenNLP required by this repo, the text_to_instance
method of DatasetReader
(which is inherited by our DeCLUTRDatasetReader
) accepts an argument text
. However, in newer versions of AllenNLP this argument is called inputs
. Hence the error you are getting:
TypeError: DeCLUTRDatasetReader.text_to_instance: `inputs` must be present.
You can check the version of AllenNLP you have installed by running
pip freeze | grep "allennlp*"
in your python environment where you have installed this repo. I would try installing a supported version and trying this example again.
Closing, please re-open if I didn't solve your issue!
I am running the sample code snippet as shared on your repo as shown below:
I get the below error:
Please help me resolve this.