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

Newer transformers is incompatible with polyjuice_nlp #1

Closed
qiaw99 opened this issue Mar 14, 2023 · 2 comments · Fixed by #16
Closed

Newer transformers is incompatible with polyjuice_nlp #1

qiaw99 opened this issue Mar 14, 2023 · 2 comments · Fixed by #16
Labels
bug Something isn't working

Comments

@qiaw99
Copy link
Collaborator

qiaw99 commented Mar 14, 2023

1.

While testing cfe code, which requires both transformers and polyjuice_nlp packages, figures out that after installing everything needed according to the offical website from polyjuice_nlp, there is always an error:

ValueError: The following `model_kwargs` are not used by the model: ['n'] (note: typos in the generate arguments will also show up in this list)

This issue is also mentioned in repo of transformers.

The easiest way to solve it, is just to use lower version.

2.

If running code and encounter this problem:

AttributeError: Can't get attribute 'Trie' on <module 'transformers.tokenization_utils'. 

One similar issue can be found here.

Make sure that your transformers version is 4.18.0

3.

If you want to install polyjuice_nlp, it's better to clone the git and install then directly(instead of pip/conda).

@nfelnlp nfelnlp added the bug Something isn't working label Mar 15, 2023
@qiaw99
Copy link
Collaborator Author

qiaw99 commented Mar 27, 2023

If you encounter this error using polyjuice:

KeyError: 'generated_text'

Then just install the package from source code

git clone [email protected]:tongshuangwu/polyjuice.git
cd polyjuice
pip install -e .

Meanwhile, make sure you have install nltk and spacy.

pip install -U pip setuptools wheel
pip install -U spacy
python -m spacy download en_core_web_sm

And you have to put these code before you execute code from polyjuice

import nltk
nltk.download('omw-1.4')

import spacy
spacy.load('en_core_web_sm')

@qiaw99
Copy link
Collaborator Author

qiaw99 commented Mar 30, 2023

Please just run the script under utils for convenience

@qiaw99 qiaw99 linked a pull request Mar 30, 2023 that will close this issue
1 task
@qiaw99 qiaw99 closed this as completed Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants