Giter VIP home page Giter VIP logo

Comments (10)

dangl00 avatar dangl00 commented on September 26, 2024 8

Make sure that you have transformers version 4.38.2 as "top_k_top_p_filtering" is removed in the next version. Then, as previously mentioned by @ashokchhetri7 , importing it from"transformers.generation.utils" should work.

from trl.

elyhahami18 avatar elyhahami18 commented on September 26, 2024 3

pip install transformers==4.38.2 worked for me as well

from trl.

jstephencorey avatar jstephencorey commented on September 26, 2024 1

Changing the transformer version to 4.38.2 did work for me, as well.

from trl.

lvwerra avatar lvwerra commented on September 26, 2024

Thanks for pointing this out. I made a hard dependency to the transformers (2.6.0) library to avoid such issues (see commit 1662d78). I will upgrade the library to transformers 3.0 at a later time. In the meantime, feel free to create a PR if you have time to test if the library works under transformers 3.0.

To upgrade the library use pip install trl==0.0.2.

from trl.

ashokchhetri7 avatar ashokchhetri7 commented on September 26, 2024

So, in the previous code, the top_k_top_p_filtering was imported from the transformers.generation_utils. I changed underscore to . as shown in following and it solved my problem:

from transformers.generation.utils import top_k_top_p_filtering

from trl.

Aryan-Deshpande avatar Aryan-Deshpande commented on September 26, 2024

image
After directly installing transformer from its repository.
and using latest version of trl, im still encountering this error

from trl.

polarbeargo avatar polarbeargo commented on September 26, 2024

Same here I encountered the same error as @Aryan-Deshpande this week. Last week can import SFTTrainer without this error.

from trl.

Aryan-Deshpande avatar Aryan-Deshpande commented on September 26, 2024

I might have found the issue with this, we have to import TrainerArguments from transformers instead.
'from transformers import TrainerArguments' please correct me if i am wrong.

from trl.

polarbeargo avatar polarbeargo commented on September 26, 2024

In my case, My original work already separated import SFTTrainer and TrainerArguments but still burst the same error
git

from trl.

aseef2289 avatar aseef2289 commented on September 26, 2024

pip install transformers==4.38.2 worked for me as well

image
image
I'm still getting the import error even with transformers==4.38.2

Any idea what could be wrong here?

from trl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.