Skip to content

jawrainey/hfta

Repository files navigation

HuggingFace Tokenizers on Android (HFTA)

Reference implementation using HuggingFace's (HF) tokenizers in Android.

Demo Video

UI to show text to tokens via the tokenizers library in real-time on Android at demo/demo.mp4:

demo.mp4

Try a Tokenizer

  1. Find a model you want to test on HF, e.g., Google's gemma-3-4b-it
  2. Download and add the tokenizer.json to app/src/main/assets named gemma-3-4b-it.json
  3. Modify SELECTED_TOKENIZER in app/build.gradle.kts

Features

Implementation Details

Run any HF's tokenizer on Android using the associated tokenizers.json from huggingface.co. To achieve that, the HF library is built via rust into a shared library and uses Java Native Interface (JNI) to load the library.

Thanks to

About

Reference implementation: run any huggingface tokenizer in Android (rust).

Topics

Resources

Stars

Watchers

Forks

Contributors