xenova / transformers.js

State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!
https://huggingface.co/docs/transformers.js
Apache License 2.0
9.71k stars 571 forks source link

Support stopping criteria for sequence generation #786

Open hans00 opened 3 weeks ago

hans00 commented 3 weeks ago

Feature request

ref: https://github.com/huggingface/transformers/blob/main/src/transformers/generation/stopping_criteria.py

Motivation

This will helpful for abstraction EOS stopping, max length stopping etc. And could support stop words.

Your contribution

I'll implement it if I have time.

xenova commented 3 weeks ago

Hi there 👋 This has been added to v3 (see here).