Giter VIP home page Giter VIP logo

Comments (6)

xenova avatar xenova commented on July 29, 2024 2

Awesome! Closing now πŸ˜„

from transformers.js.

xenova avatar xenova commented on July 29, 2024 1

12163dd should fix this πŸ‘ Let me know if it works!

Here's some example code:

const pipe = await pipeline('translation', 'Helsinki-NLP/opus-mt-en-mul');
const result = await pipe(">>jpn<< I love pizza", {
    do_sample: false,
    num_beams: 1
});
// Outputs: [{translation_text: 'ピアを愛してる'}]

I will close the issue once I publish a full release.

from transformers.js.

takoyaro avatar takoyaro commented on July 29, 2024 1

You're right! I didn't account for that, my bad! Let me work on that.

Here's the part of the code I missed: https://github.com/huggingface/transformers/blob/12d51db243a00726a548a43cc333390ebae731e3/src/transformers/models/marian/tokenization_marian.py#L204-L213

Good catch!

12163dd indeed fixes the issue, thank you!

from transformers.js.

xenova avatar xenova commented on July 29, 2024

You're right! I didn't account for that, my bad! Let me work on that.

Here's the part of the code I missed:
https://github.com/huggingface/transformers/blob/12d51db243a00726a548a43cc333390ebae731e3/src/transformers/models/marian/tokenization_marian.py#L204-L213

from transformers.js.

ldenoue avatar ldenoue commented on July 29, 2024

Could this be related to #66 ?

from transformers.js.

xenova avatar xenova commented on July 29, 2024

Could this be related to #66 ?

Although the error message is the same, I think that's just a general error that onnxruntime throws when something goes wrong :/ That's the reason I added the extra logging statements so that we can perhaps see what the actual issue is.

One thing that might be causing it is an out-of-memory issue which can happen if too many beams are being run (which happens since the default config, which comes from the python library, has num_beams set to something > 1). I'll have to look into it a bit more though.

from transformers.js.

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.