Giter Site home page Giter Site logo

Comments (8)

user1342 avatar user1342 commented on May 29, 2024 2

As a quick fix for this. On version 0.5.0, I was able to get around this error by commenting out line 2572 in modeling_utils.py (see this fork of transformers):

Replace:
folder = os.path.sep.join(resolved_archive_file[0].split(os.path.sep)[:-1])
with
#folder = os.path.sep.join(resolved_archive_file[0].split(os.path.sep)[:-1])

I'm unsure if this fix will have repercussions later down the line, however, for the time being it seems to be working.

from detoxify.

laurahanu avatar laurahanu commented on May 29, 2024 1

Hey all, thanks for raising this and good to see there's a workaround!

We will look into this asap!

from detoxify.

MartinPicc avatar MartinPicc commented on May 29, 2024 1

It is working for me with version 4.24.0, the next version however raises this error.
I believe it comes from this specific PR on transformers library merged in 4.25.1 huggingface/transformers#20321

However, it's not clear for me if this is an expected behavior on tranformers' side or if they introduced a bug

from detoxify.

robvanvolt avatar robvanvolt commented on May 29, 2024

Me too... python 3.8 on Linux. Maybe this is related to the latest release? It worked fine before.

from detoxify.

annabechang avatar annabechang commented on May 29, 2024

As a quick fix for this. On version 0.5.0, I was able to get around this error by commenting out line 2572 in modeling_utils.py (see this fork of transformers):

Replace: folder = os.path.sep.join(resolved_archive_file[0].split(os.path.sep)[:-1]) with #folder = os.path.sep.join(resolved_archive_file[0].split(os.path.sep)[:-1])

I'm unsure if this fix will have repercussions later down the line, however, for the time being it seems to be working.

thank you, this work for me as well!

from detoxify.

chrisji avatar chrisji commented on May 29, 2024

As a workaround, the v4.22.1 release of transformers appears to work as expected. So if installing via pip:

pip install detoxify
pip install transformers==4.22.1

(Other versions between the latest release and v4.22.1 may also work)

from detoxify.

laurahanu avatar laurahanu commented on May 29, 2024

Hey everyone, pinned the transformers version to 4.22.1 as a quick fix for now as we investigate this problem further, everything should hopefully work as expected if you reinstall the package/upgrade the transformers version!

from detoxify.

MartinPicc avatar MartinPicc commented on May 29, 2024

It is apparently a bug on transformers side, and it should be fixed in next release with this PR: huggingface/transformers#21542

If you need a solution right now, you can also install transformers from their main branch directly, the PR is merged already

from detoxify.

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.