rsvalerio commited on
Commit
1825eb0
·
verified ·
1 Parent(s): e4e3df7

Update model card

Browse files
Files changed (1) hide show
  1. README.md +49 -0
README.md ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - coreml
5
+ - sentence-transformers
6
+ - embedding
7
+ - nomic
8
+ - code
9
+ base_model: nomic-ai/nomic-embed-code
10
+ library_name: coremltools
11
+ pipeline_tag: feature-extraction
12
+ ---
13
+
14
+ # nomic-embed-code — CoreML (.mlpackage)
15
+
16
+ CoreML conversion of [nomic-ai/nomic-embed-code](https://huggingface.co/nomic-ai/nomic-embed-code) for native Apple Neural Engine / GPU inference on macOS and iOS.
17
+
18
+ ## Files
19
+
20
+ | File | Description |
21
+ |------|-------------|
22
+ | `model.mlpackage/` | CoreML model (FP16, flexible shapes) |
23
+ | `tokenizer.json` | HF fast tokenizer |
24
+ | `config.json` | Model configuration |
25
+
26
+ ## Details
27
+
28
+ - **Architecture**: NomicBERT (RoPE, SwiGLU, no token_type_ids)
29
+ - **Precision**: FP16 (native ANE precision)
30
+ - **Compute units**: `.all` — CoreML schedules across ANE, GPU, and CPU
31
+ - **Input shapes**: batch=1, seq_len=1..8192 (flexible range)
32
+ - **Embedding dimension**: 768
33
+
34
+ ## Usage with cai
35
+
36
+ ```bash
37
+ cai index --embed-backend swift --embed-model "rsvalerio/nomic-embed-code-coreml"
38
+ ```
39
+
40
+ The Swift backend downloads the `.mlpackage` from this repo, compiles it to `.mlmodelc` on first run (~30-60s), and caches the compiled model for subsequent runs.
41
+
42
+ ## Conversion
43
+
44
+ Converted using [rsvalerio/models](https://github.com/rsvalerio/models) CI pipeline with `coremltools`.
45
+
46
+ ```bash
47
+ pip install coremltools transformers torch
48
+ python convert.py
49
+ ```