加载中…
加载中…
intfloat/multilingual-e5-small converted to a Core ML ML Program (fp16) for on-device semantic search in the DND Master app (iPad / iPhone / Mac).
| File | Purpose |
|---|---|
MultilingualE5Small.mlpackage |
Core ML model. Inputs input_ids, attention_mask (int32, shape [1, L], L ∈ {16, 32, 64, 128, 256, 512}); output embedding [1, 384] — masked mean pooling and L2 normalisation are inside the graph. |
tokenizer.json, tokenizer_config.json, special_tokens_map.json, config.json |
XLM-R tokenizer files from the upstream repo, unchanged. |
Pad token id is 1 (<pad>), attention mask is 1 for real tokens. Use the
e5 prefixes: query: for queries, passage: for documents.
minimum_deployment_target = iOS18.RangeDim: with a flexible range Core ML
returned NaN (“Data-dependent shapes were disabled”).-1e4 before tracing: the
default finfo(float32).min overflows to -inf in fp16 and the softmax
produces NaN..cpuAndNeuralEngine. The GPU path is ~25× slower
for this graph on Apple silicon.The conversion script lives in the app repository (BestiaryEmbedder/convert-e5-coreml.py).
The weights are derived from intfloat/multilingual-e5-small (MIT).