huggingface / swift-transformers

Swift Package to implement a transformers-like API in Swift
Apache License 2.0
718 stars 80 forks source link

Public token <-> id conversion + Unknown Tokens #32

Closed pcuenca closed 10 months ago

pcuenca commented 10 months ago

I used an API similar to transformers. To do (in new PRs, potentially):

cc @ZachNagengast, feel free to review!

pcuenca commented 10 months ago

@ZachNagengast I further checked the Python code and brought over the relevant changes:

Tests now pass for the various tokenizers we are considering, and comparing against the well-known Python unknown token ids.