Giter Site home page Giter Site logo

`stop_strings` Argument in `model.generate()` Results in Exception if Generation Completes Without `stop_string` Being Generated about transformers HOT 6 CLOSED

lapp0 avatar lapp0 commented on July 24, 2024 1
`stop_strings` Argument in `model.generate()` Results in Exception if Generation Completes Without `stop_string` Being Generated

from transformers.

Comments (6)

Rocketknight1 avatar Rocketknight1 commented on July 24, 2024 2

Fix is open here

from transformers.

zucchini-nlp avatar zucchini-nlp commented on July 24, 2024 1

Seems that the bug appears only when the stop string is a single letter, because in that case it's impossible to get token_valid_positions not empty. cc @Rocketknight1 here also

And the tokenizer-related issue is a bug, will be fixed soon!

from transformers.

lapp0 avatar lapp0 commented on July 24, 2024

Might be a duplicate of #31435

from transformers.

lapp0 avatar lapp0 commented on July 24, 2024

It looks like this line sets the tokenizer to None automatically, creates a related but not identical issue.

https://github.com/huggingface/transformers/blob/eed9ed67987/src/transformers/generation/utils.py#L1643

@ahmed-moubtahij could you please take a look? Popping tokenizer from kwargs twice guarantees it will be None even if passed.

from transformers.

Rocketknight1 avatar Rocketknight1 commented on July 24, 2024

On it!

from transformers.

ahmed-moubtahij avatar ahmed-moubtahij commented on July 24, 2024

It looks like this line sets the tokenizer to None automatically, creates a related but not identical issue.

https://github.com/huggingface/transformers/blob/eed9ed67987/src/transformers/generation/utils.py#L1643

@ahmed-moubtahij could you please take a look? Popping tokenizer from kwargs twice guarantees it will be None even if passed.

@lapp0 Thanks for the headsup! I just forked to remove it but @gante outsped me :)

Not sure how critical, but the "we only use it for stopping criteria" comment doesn't stand anymore

from transformers.

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.