GithubHelp home page GithubHelp logo

Comments (8)

xenova avatar xenova commented on May 20, 2024

Could you provide the command used to convert it? Which task did you use? It may be because you are not exporting using -with-past (but that is just a guess).

The command I would use is:

python ./scripts/convert.py --model_id facebook/bart-large-cnn --from_hub --quantize --task seq2seq-lm-with-past

from transformers.js.

spencekim avatar spencekim commented on May 20, 2024

Yep that's the exact command I used. If you'd like, I could upload the files to your HuggingFace repo (https://huggingface.co/Xenova/transformers.js/tree/main) to make sure they look ok.

from transformers.js.

xenova avatar xenova commented on May 20, 2024

No worries - I'll convert it on my side. Then it's most likely something I'd need to fix. The strange thing is, other model types (with the same model type, i.e., "bart") need the encoder attention mask (vs. what you are showing, which doesn't).

from transformers.js.

xenova avatar xenova commented on May 20, 2024

Okay yep I was able to reproduce it on my side. As I said above, it's very strange that some bart models need it, while others dont... I'll make it work either way :)

EDIT: Okay I got it working (basically I just made it only add it if explicitly required by the decoder:
image

However, the output I got was a little strange:
[{"summary_text":"TheTower is 324 metres ( \"). It is the tallest in The Eiffel Tower is the tallest. The tower is the second tallest free-standing structure in France."}]

I assume it has a different type of tokenization that isn't yet supported. I'm off to bed now, but I'll look into it tomorrow. Once that's fixed, I'll push the changes :)

from transformers.js.

xenova avatar xenova commented on May 20, 2024

Got it working :)
[{"summary_text":"The Eiffel Tower is the tallest structure in Paris. It is 324 metres (1,063 ft) tall, about the same height as an 81-storey building."}]

Will push changes soon.

from transformers.js.

xenova avatar xenova commented on May 20, 2024

Looks like the commit automatically closed the issue. Whoops.

Can you confirm the changes work (I think you can install an npm package from GitHub), and if so, I will push this in version 1.2.6

from transformers.js.

spencekim avatar spencekim commented on May 20, 2024

Sorry for the late response. It works great!

Side note, any plans to set up Typescript types, and/or support onnxruntime-node? Both would be super useful. I'd be open to helping implement it as well.

from transformers.js.

xenova avatar xenova commented on May 20, 2024

Sorry for the late response. It works great!

Great!

Side note, any plans to set up Typescript types, and/or support onnxruntime-node? Both would be super useful. I'd be open to helping implement it as well.

Absolutely! We currently have a couple of people working on the typescript side of things (#26 and #28)

For onnxruntime-node, I suppose it would be a question of how to support both web and node versions of onnxruntime without duplicating code. If you have any ideas, or know how to do that, feel free to open up a PR!

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.