transformers.js
5ddc4722 - Add support for nougat models (`image-to-text`) (#391)

Commit
1 year ago
Add support for nougat models (`image-to-text`) (#391) * Add `NougatTokenizer` * Add nougat unit tests * Add support for `NougatImageProcessor` * Add `crop` function to `RawImage` * Fix `RawImage` save function OffscreenCanvas does not have `toDataURL` function * Add listed support for nougat models * Fix `min`/`max` function typing * Add unknown token to tokenizer class * Implement `NoBadWordsLogitsProcessor` * Use `NoBadWordsLogitsProcessor` in `generate` * Fix regex group substitutions Python uses \1, \2, etc. for group substitutions, but JavaScript uses $1, $2, etc. * Create `regexSplit` helper function to split but keep delimiter * Fix splitting for String pattern types * Fix docstring
Author
Parents
  • File
    README.md
  • docs/snippets
    • 6_supported-models.snippet
  • scripts
    • File
      supported_models.py
  • src
    • File
      models.js
    • File
      processors.js
    • File
      tokenizers.js
    • utils
      • File
        generation.js
      • File
        image.js
      • File
        maths.js
  • tests
    • File
      processors.test.js
Loading