TinyGPT2 for TinyBrain
This repository packages sshleifer/tiny-gpt2 for the TinyBrain runtime on Apple Watch.
TinyBrain bundle contract
The conversion script produces a single bundle archive:
tinygpt2_only_logits.mlmodelc.zip
The zip layout is:
tinygpt2_only_logits.mlmodelc/
tokenizer/
metadata.json
Runtime interface
- Task: causal language modeling
- Inputs:
input_ids (Int32, shape 1 x 16)
attention_mask (Int32, shape 1 x 16)
- Output:
Files included in tokenizer/
tokenizer.json when provided by Transformers
vocab.json
merges.txt
special_tokens_map.json
tokenizer_config.json
token_decoder.json
Build
Run:
python3 convert_tinygpt2_to_coreml.py
The script:
- Downloads the model and tokenizer from Hugging Face.
- Converts the model to Core ML.
- Compiles the package to
.mlmodelc.
- Writes TinyBrain runtime metadata.
- Packages the compiled model, tokenizer, and metadata into one zip.