-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Can not import name top_k_top_p_filtering #1409
Comments
Same here I encountered the same error this week. Last week can imported SFTTrainer without this error. Another developer also bumped into this error this week see this closed issue |
Make sure that you have transformers version 4.38.2. Then, importing 'top_k_top_p_filtering' from"transformers.generation.utils" should work. |
I would like to continue finetuning starcoder2. So I have to install transformers from the source with I tried to install top_k_top_p_filtering (cannot install DPOTRainer becuse of this) as suggested above but I get an error ImportError Traceback (most recent call last) ImportError: cannot import name 'top_k_top_p_filtering' from 'transformers.generation.utils' (/usr/local/lib/python3.10/dist-packages/transformers/generation/utils.py) NOTE: If your import is failing due to a missing package, you can To view examples of installing some common dependencies, click the What is the workaround for installing DPOTrainer for the latest transformer version? Thanks |
I use
AND it worked for me |
i also used
and it worked for me |
Upgrading it worked for me as well. |
Upgrading it didn't work for me.555 |
i also used pip install --upgrade trl and it worked for me |
Hello everyone, I just came across this kind of error, I cannot import trl because of this kind of error:
ImportError: cannot import name 'top_k_top_p_filtering' from 'transformers' (/usr/local/lib/python3.10/dist-packages/transformers/__init__.py)
although I upgrade transformers library, it remained not working
trl/trl/core.py
Line 25 in 22b4f54
The text was updated successfully, but these errors were encountered: