{"id":17491788,"url":"https://github.com/elixir-nx/tokenizers","last_synced_at":"2025-04-05T21:09:02.802Z","repository":{"id":37101250,"uuid":"458383564","full_name":"elixir-nx/tokenizers","owner":"elixir-nx","description":"Elixir bindings for 🤗 Tokenizers","archived":false,"fork":false,"pushed_at":"2023-12-13T16:23:17.000Z","size":2428,"stargazers_count":85,"open_issues_count":0,"forks_count":14,"subscribers_count":11,"default_branch":"main","last_synced_at":"2024-03-14T19:04:05.060Z","etag":null,"topics":["elixir","machine-learning","rust","text-processing"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/tokenizers","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elixir-nx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS.md","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-02-12T00:48:12.000Z","updated_at":"2024-04-22T08:33:26.073Z","dependencies_parsed_at":"2023-10-10T18:48:57.731Z","dependency_job_id":"f095b155-aef8-450b-80ba-2caebc0ea88d","html_url":"https://github.com/elixir-nx/tokenizers","commit_stats":{"total_commits":38,"total_committers":9,"mean_commits":4.222222222222222,"dds":0.7105263157894737,"last_synced_commit":"be0b12d10dd72ab3b4be5029d7828d4830e86ab9"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-nx%2Ftokenizers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-nx%2Ftokenizers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-nx%2Ftokenizers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-nx%2Ftokenizers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elixir-nx","download_url":"https://codeload.github.com/elixir-nx/tokenizers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399878,"owners_count":20932880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","machine-learning","rust","text-processing"],"created_at":"2024-10-19T08:04:59.758Z","updated_at":"2025-04-05T21:09:02.782Z","avatar_url":"https://github.com/elixir-nx.png","language":"Elixir","readme":"# Tokenizers\n\n![CI](https://github.com/elixir-nx/explorer/actions/workflows/ci.yml/badge.svg)\n\nElixir bindings for [Hugging Face Tokenizers](https://github.com/huggingface/tokenizers).\n\n## Installation\n\nYou can add `:tokenizers` as dependency in your `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:tokenizers, \"~\u003e 0.3.0\"},\n  ]\nend\n```\n\nIf you are using Livebook or IEx, you can instead run:\n\n```elixir\nMix.install([\n  {:tokenizers, \"~\u003e 0.3.0\"},\n])\n```\n\n## Example\n\nYou can use any pre-trained tokenizer from any model repo on Hugging Face Hub, such as [bert-base-cased](https://huggingface.co/bert-base-cased).\n\n```elixir\n{:ok, tokenizer} = Tokenizers.Tokenizer.from_pretrained(\"bert-base-cased\")\n{:ok, encoding} = Tokenizers.Tokenizer.encode(tokenizer, \"Hello there!\")\nTokenizers.Encoding.get_tokens(encoding)\n#=\u003e [\"Hello\", \"there\", \"!\"]\nTokenizers.Encoding.get_ids(encoding)\n#=\u003e [8667, 1175, 106]\n```\n\nThe [notebooks](./notebooks) directory has [an introductory Livebook](./notebooks/pretrained.livemd) to give you a feel for the API.\n\n## Contributing\n\nTokenizers uses Rust to call functionality from the Hugging Face Tokenizers library. While\nRust is not necessary to use Tokenizers as a package, you need Rust tooling installed on\nyour machine if you want to compile from source, which is the case when contributing to\nTokenizers. In particular, you will need Rust Stable, which can be installed with\n[Rustup](https://rust-lang.github.io/rustup/installation/index.html).\n\n## License\n\nCopyright (c) 2022 Christopher Grainger\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-nx%2Ftokenizers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felixir-nx%2Ftokenizers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-nx%2Ftokenizers/lists"}