rsvalerio commited on
Commit
3e6bcab
·
verified ·
1 Parent(s): 6fcad6b

Update model card

Browse files
Files changed (1) hide show
  1. README.md +48 -0
README.md ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - coreml
5
+ - sentence-transformers
6
+ - embedding
7
+ - code
8
+ - bert
9
+ base_model: bigcode/starencoder
10
+ library_name: coremltools
11
+ pipeline_tag: feature-extraction
12
+ ---
13
+
14
+ # starencoder — CoreML (.mlpackage)
15
+
16
+ CoreML conversion of [bigcode/starencoder](https://huggingface.co/bigcode/starencoder) 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
+
25
+ ## Details
26
+
27
+ - **Architecture**: BERT (encoder-only, trained on The Stack code dataset)
28
+ - **Precision**: FP16 (native ANE precision)
29
+ - **Compute units**: `.all` — CoreML schedules across ANE, GPU, and CPU
30
+ - **Input shapes**: batch=1..512, seq_len=1..1024 (flexible range)
31
+ - **Embedding dimension**: 768
32
+
33
+ ## Usage with cai
34
+
35
+ ```bash
36
+ cai index --embed-backend swift --embed-model "rsvalerio/starencoder-coreml"
37
+ ```
38
+
39
+ 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.
40
+
41
+ ## Conversion
42
+
43
+ Converted using [rsvalerio/models](https://github.com/rsvalerio/models) CI pipeline with `coremltools`.
44
+
45
+ ```bash
46
+ pip install coremltools transformers torch
47
+ python convert.py
48
+ ```