rolf-mozilla commited on
Commit
e374578
·
verified ·
1 Parent(s): f7fef32

Upload 7 files

Browse files
.gitattributes ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ models/mozilla/translations-en-fr-static/fp16.d384.npy filter=lfs diff=lfs merge=lfs -text
2
+ models/mozilla/translations-en-fr-static/fp32.d384.npy filter=lfs diff=lfs merge=lfs -text
3
+ models/mozilla/translations-en-fr-static/fp8_e4m3.d384.npy filter=lfs diff=lfs merge=lfs -text
4
+ models/mozilla/translations-en-fr-static/fp8_e5m2.d384.npy filter=lfs diff=lfs merge=lfs -text
models/mozilla/translations-en-fr-static/README.md ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Translations en-fr static embeddings (Firefox layout)
2
+
3
+ Generated by `build_firefox_static_model.py` from a Model2Vec StaticModel.
4
+
5
+ - source Model2Vec model: `en-fr-static-model2vec-sif`
6
+ - embedding source: `bergamot_marian_wemb`
7
+ - vocab size: 32000
8
+ - dimensions exported: [384]
9
+ - dtypes: ['fp32', 'fp16', 'fp8_e5m2', 'fp8_e4m3']
10
+
11
+ ## Weighting
12
+
13
+ - scheme: `sif`
14
+ - formula: `a / (a + probability)`
15
+ - `a`: 0.0003
16
+
17
+ The per-piece weighting is baked into the stored vectors, because Model2Vec
18
+ pools with an unweighted mean. That is equivalent to weighting at pooling
19
+ time: the two differ only by a positive scalar, which L2 normalization
20
+ removes.
21
+
22
+ ## Common components (`ccr.d{dim}.npy`)
23
+
24
+ Orthonormal directions that `StaticEmbeddingsPipeline` projects out of each
25
+ pooled embedding before normalizing -- step (b) of SIF, which a bare
26
+ mean-pool omits. Set `staticEmbeddingsOptions.commonComponents` to the number
27
+ of rows to use; the file intentionally contains more than that so the value
28
+ can be retuned without re-exporting.
29
+
30
+ - fitted on ['text_en', 'text_fr'] from `['docs.parquet']`
31
+ - fit by replicating the runtime path (tokenizer.json, gather, unweighted
32
+ mean, no normalization), so the distribution matches inference
33
+ - re-fit per dimension; a truncated direction is not the principal direction
34
+ of the truncated space
35
+ - fit on fp32 and reused for every dtype
36
+
37
+ | dim | rows | variance explained (k=4) | (k=8) |
38
+ |---|---|---|---|
39
+ | 384 | 16 | 0.2003 | 0.2691 |
40
+
41
+ ## Caveats
42
+
43
+ - The fitting corpus is a translated English browsing set, so the French side
44
+ is translationese rather than native French browsing.
45
+ - `a` and the row count were selected on that same evaluation, so the
46
+ measured gain is mildly optimistic.
models/mozilla/translations-en-fr-static/ccr.d384.npy ADDED
Binary file (24.7 kB). View file
 
models/mozilla/translations-en-fr-static/fp16.d384.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b373ebddf5c799c14e604420cbf83ad6cf7d465070458076f6af5e131480865
3
+ size 24576128
models/mozilla/translations-en-fr-static/fp32.d384.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a6de82582b3f3e64c38fab6612ff4e7890d46a18ff543a2c0225c4ea0aef651f
3
+ size 49152128
models/mozilla/translations-en-fr-static/fp8_e4m3.d384.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d0bc3cce7c4f0b8a2495501ddd907f63050af8905a0c97d50d3203c758ef4880
3
+ size 12288128
models/mozilla/translations-en-fr-static/fp8_e5m2.d384.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9425c9ce062360819e0ca6a5e146505c9943defde38ab20723ad064d78afd197
3
+ size 12288128
models/mozilla/translations-en-fr-static/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff