Eugene Hauptmann Cursor commited on
Commit ·
4a67e4a
1
Parent(s): f565491
Add RLXP, F16 safetensors, F32 GGUF, and native .bin weight formats.
Browse files- PUBLISH.md +13 -2
- README.md +17 -7
- SHA256SUMS +14 -5
- config.json +7 -1
- glucofm_encoder.bin +3 -0
- glucofm_encoder.f16.rlxp +3 -0
- glucofm_encoder.f16.safetensors +3 -0
- glucofm_encoder.f32.gguf +3 -0
- glucofm_encoder.rlxp +3 -0
- glucofm_encoder.safetensors +1 -1
PUBLISH.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
| 3 |
This directory is a **standalone** git repository. It is ignored by the parent
|
| 4 |
`glucofm` code repo (see root `.gitignore`: `/artifacts/`).
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
## One-time setup
|
| 7 |
|
| 8 |
```bash
|
|
@@ -10,7 +21,7 @@ cd artifacts
|
|
| 10 |
# already initialized if you used the prep script; otherwise:
|
| 11 |
# git init
|
| 12 |
# git lfs install
|
| 13 |
-
# git lfs track "*.onnx" "*.safetensors" "*.gguf"
|
| 14 |
|
| 15 |
huggingface-cli login
|
| 16 |
# Create an empty model repo on HF (web UI or):
|
|
@@ -18,7 +29,7 @@ huggingface-cli login
|
|
| 18 |
|
| 19 |
git remote add origin https://huggingface.co/<USER>/glucofm-encoder
|
| 20 |
git add -A
|
| 21 |
-
git commit -m "Add GlucoFM encoder weights (safetensors, GGUF, ONNX)"
|
| 22 |
git push -u origin main
|
| 23 |
```
|
| 24 |
|
|
|
|
| 3 |
This directory is a **standalone** git repository. It is ignored by the parent
|
| 4 |
`glucofm` code repo (see root `.gitignore`: `/artifacts/`).
|
| 5 |
|
| 6 |
+
## Regenerate weights
|
| 7 |
+
|
| 8 |
+
From the parent crate:
|
| 9 |
+
|
| 10 |
+
```bash
|
| 11 |
+
cargo run --release --features infer,onnx --example convert_weights -- \
|
| 12 |
+
--from artifacts/glucofm_encoder.onnx --all artifacts/
|
| 13 |
+
cd artifacts && shasum -a 256 glucofm_encoder.* config.json LICENSE README.md PUBLISH.md \
|
| 14 |
+
| sort -k2 > SHA256SUMS
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
## One-time setup
|
| 18 |
|
| 19 |
```bash
|
|
|
|
| 21 |
# already initialized if you used the prep script; otherwise:
|
| 22 |
# git init
|
| 23 |
# git lfs install
|
| 24 |
+
# git lfs track "*.onnx" "*.safetensors" "*.gguf" "*.rlxp" "*.bin"
|
| 25 |
|
| 26 |
huggingface-cli login
|
| 27 |
# Create an empty model repo on HF (web UI or):
|
|
|
|
| 29 |
|
| 30 |
git remote add origin https://huggingface.co/<USER>/glucofm-encoder
|
| 31 |
git add -A
|
| 32 |
+
git commit -m "Add GlucoFM encoder weights (safetensors, GGUF, RLXP, ONNX, bin)"
|
| 33 |
git push -u origin main
|
| 34 |
```
|
| 35 |
|
README.md
CHANGED
|
@@ -9,6 +9,7 @@ tags:
|
|
| 9 |
- onnx
|
| 10 |
- safetensors
|
| 11 |
- gguf
|
|
|
|
| 12 |
- healthcare
|
| 13 |
pipeline_tag: feature-extraction
|
| 14 |
---
|
|
@@ -28,15 +29,21 @@ converted for the Rust [`glucofm`](https://crates.io/crates/glucofm) / RLX stack
|
|
| 28 |
| File | Format | Notes |
|
| 29 |
|------|--------|-------|
|
| 30 |
| `glucofm_encoder.safetensors` | F32 safetensors | **Preferred** for `glucofm` load / train warm-start |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
| `glucofm_encoder.f16.gguf` | GGUF F16 | Smaller disk; dequantized at load |
|
| 32 |
| `glucofm_encoder.q8.gguf` | GGUF Q8_0 | ~4× smaller than F32; dequantized at load |
|
|
|
|
| 33 |
| `glucofm_encoder.onnx` | ONNX opset 17 | Upstream OpenCGM export (raw grid → 128-d embedding) |
|
| 34 |
| `glucofm_encoder.onnx.meta.json` | JSON | Upstream export metadata |
|
| 35 |
| `config.json` | JSON | Geometry + param counts for this package |
|
| 36 |
| `SHA256SUMS` | text | Integrity checks |
|
| 37 |
|
| 38 |
-
**Encoder params:** 435,
|
| 39 |
-
|
|
|
|
| 40 |
|
| 41 |
Paper full trainable target (encoder + JEPA heads): **732,593**.
|
| 42 |
|
|
@@ -55,7 +62,7 @@ Paper full trainable target (encoder + JEPA heads): **732,593**.
|
|
| 55 |
- Upstream community encoder: [`sfourdrinier/opencgm-stateevent`](https://huggingface.co/sfourdrinier/opencgm-stateevent)
|
| 56 |
- OpenCGM project: [sfourdrinier/opencgm](https://github.com/sfourdrinier/opencgm)
|
| 57 |
- Paper: [arXiv:2605.30865](https://arxiv.org/abs/2605.30865)
|
| 58 |
-
- Conversion via `glucofm` `convert_weights`
|
| 59 |
|
| 60 |
Upstream ONNX meta (epoch 40 seed 17, raw stats, circadian, learnable σ) is kept in
|
| 61 |
`glucofm_encoder.onnx.meta.json`.
|
|
@@ -63,10 +70,13 @@ Upstream ONNX meta (epoch 40 seed 17, raw stats, circadian, learnable σ) is kep
|
|
| 63 |
## Use with `glucofm`
|
| 64 |
|
| 65 |
```bash
|
| 66 |
-
# After cloning this HF repo next to your project, or downloading files:
|
| 67 |
cargo run --release --features infer --example infer -- \
|
| 68 |
--weights /path/to/glucofm_encoder.safetensors
|
| 69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
cargo run --release --features hub --example train_from_hub -- \
|
| 71 |
--weights /path/to/glucofm_encoder.safetensors --steps 50
|
| 72 |
```
|
|
@@ -75,14 +85,14 @@ cargo run --release --features hub --example train_from_hub -- \
|
|
| 75 |
use glucofm::prelude::*;
|
| 76 |
|
| 77 |
let mut model = GlucoFm::for_inference(GlucoFmConfig::default(), InferOptions::default(), &mut rng)?;
|
| 78 |
-
model.load_weights_path("glucofm_encoder.
|
| 79 |
let emb = model.encode_embedding_day(&day, &mut rng)?; // [128]
|
| 80 |
```
|
| 81 |
|
| 82 |
## Formats
|
| 83 |
|
| 84 |
-
- Prefer **safetensors** for numeric fidelity with RLX `Param` graphs.
|
| 85 |
-
- **GGUF**
|
| 86 |
(no in-graph Q8 matmul).
|
| 87 |
|
| 88 |
## License
|
|
|
|
| 9 |
- onnx
|
| 10 |
- safetensors
|
| 11 |
- gguf
|
| 12 |
+
- rlxp
|
| 13 |
- healthcare
|
| 14 |
pipeline_tag: feature-extraction
|
| 15 |
---
|
|
|
|
| 29 |
| File | Format | Notes |
|
| 30 |
|------|--------|-------|
|
| 31 |
| `glucofm_encoder.safetensors` | F32 safetensors | **Preferred** for `glucofm` load / train warm-start |
|
| 32 |
+
| `glucofm_encoder.f16.safetensors` | F16 safetensors | ~2× smaller disk |
|
| 33 |
+
| `glucofm_encoder.rlxp` | RLX package F32 | Flat mmap weight-only pack (`rlxp` / `infer` feature) |
|
| 34 |
+
| `glucofm_encoder.f16.rlxp` | RLX package F16 | ~2× smaller RLXP |
|
| 35 |
+
| `glucofm_encoder.f32.gguf` | GGUF F32 | Lossless GGUF dump |
|
| 36 |
| `glucofm_encoder.f16.gguf` | GGUF F16 | Smaller disk; dequantized at load |
|
| 37 |
| `glucofm_encoder.q8.gguf` | GGUF Q8_0 | ~4× smaller than F32; dequantized at load |
|
| 38 |
+
| `glucofm_encoder.bin` | Native `GLFM` v1 | Compact glucofm-native dump |
|
| 39 |
| `glucofm_encoder.onnx` | ONNX opset 17 | Upstream OpenCGM export (raw grid → 128-d embedding) |
|
| 40 |
| `glucofm_encoder.onnx.meta.json` | JSON | Upstream export metadata |
|
| 41 |
| `config.json` | JSON | Geometry + param counts for this package |
|
| 42 |
| `SHA256SUMS` | text | Integrity checks |
|
| 43 |
|
| 44 |
+
**Encoder params in weight files:** 435,505 (OpenCGM ONNX tensors).
|
| 45 |
+
`online/mask_token` (128) is omitted upstream; `glucofm` inference defaults it to zeros.
|
| 46 |
+
Full encoder including `mask_token` + `online/gaussian.rho`: **435,633**.
|
| 47 |
|
| 48 |
Paper full trainable target (encoder + JEPA heads): **732,593**.
|
| 49 |
|
|
|
|
| 62 |
- Upstream community encoder: [`sfourdrinier/opencgm-stateevent`](https://huggingface.co/sfourdrinier/opencgm-stateevent)
|
| 63 |
- OpenCGM project: [sfourdrinier/opencgm](https://github.com/sfourdrinier/opencgm)
|
| 64 |
- Paper: [arXiv:2605.30865](https://arxiv.org/abs/2605.30865)
|
| 65 |
+
- Conversion via `glucofm` `convert_weights --all` (ONNX → safetensors / GGUF / RLXP / `.bin`)
|
| 66 |
|
| 67 |
Upstream ONNX meta (epoch 40 seed 17, raw stats, circadian, learnable σ) is kept in
|
| 68 |
`glucofm_encoder.onnx.meta.json`.
|
|
|
|
| 70 |
## Use with `glucofm`
|
| 71 |
|
| 72 |
```bash
|
|
|
|
| 73 |
cargo run --release --features infer --example infer -- \
|
| 74 |
--weights /path/to/glucofm_encoder.safetensors
|
| 75 |
|
| 76 |
+
# RLXP (same feature set)
|
| 77 |
+
cargo run --release --features infer --example infer -- \
|
| 78 |
+
--weights /path/to/glucofm_encoder.rlxp
|
| 79 |
+
|
| 80 |
cargo run --release --features hub --example train_from_hub -- \
|
| 81 |
--weights /path/to/glucofm_encoder.safetensors --steps 50
|
| 82 |
```
|
|
|
|
| 85 |
use glucofm::prelude::*;
|
| 86 |
|
| 87 |
let mut model = GlucoFm::for_inference(GlucoFmConfig::default(), InferOptions::default(), &mut rng)?;
|
| 88 |
+
model.load_weights_path("glucofm_encoder.rlxp")?; // or .safetensors / .gguf / .bin
|
| 89 |
let emb = model.encode_embedding_day(&day, &mut rng)?; // [128]
|
| 90 |
```
|
| 91 |
|
| 92 |
## Formats
|
| 93 |
|
| 94 |
+
- Prefer **safetensors** or **RLXP F32** for numeric fidelity with RLX `Param` graphs.
|
| 95 |
+
- **GGUF** / **RLXP F16** are for disk savings; runtime still uses dense F32/F16 params after load
|
| 96 |
(no in-graph Q8 matmul).
|
| 97 |
|
| 98 |
## License
|
SHA256SUMS
CHANGED
|
@@ -1,5 +1,14 @@
|
|
| 1 |
-
|
| 2 |
-
glucofm_encoder.
|
| 3 |
-
glucofm_encoder.
|
| 4 |
-
glucofm_encoder.
|
| 5 |
-
glucofm_encoder.safetensors
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
1c1dd960c71625f4dceaa67ebe62c1578a72a3f44c721a855dc5ccda4afb9a93 config.json
|
| 2 |
+
35c98270c11f07a3188aeff47eafa4a783bd1d21b197b4ea2759fe9edae010e7 glucofm_encoder.bin
|
| 3 |
+
7be81464df67fabb0e25b120a6de173c14aa2a346100c4b49a8a41b230305fcd glucofm_encoder.f16.gguf
|
| 4 |
+
856634ca98f1d465f5ae376eec10db129b03a81cd94ffb210f0428d5d952dac5 glucofm_encoder.f16.rlxp
|
| 5 |
+
78a91d83af63f59761ad149ff20aa44403eeaf3580262ccd17931099290497e5 glucofm_encoder.f16.safetensors
|
| 6 |
+
9e92a8c5ba562b25d5b69114447c996f6ec45858aa8bce97b9f3ed1fe3a21c53 glucofm_encoder.f32.gguf
|
| 7 |
+
b1349deffd15ab62a5a98d7c7c4a7e143bcf1dee7ad745b1e05533ff54f34768 glucofm_encoder.onnx
|
| 8 |
+
a84d1870d526ff06a4a5a6fdd403e44b93db2c545e584138b6de0b23fcfe7773 glucofm_encoder.onnx.meta.json
|
| 9 |
+
999e21cb0fa8ef9e6cf1386de11fcee796af827182353af537d26089b4788ce5 glucofm_encoder.q8.gguf
|
| 10 |
+
e8e3874dd11aced2a930fcce721a477b6558f929007835b9da32f2c6d8453985 glucofm_encoder.rlxp
|
| 11 |
+
f8e0011ef59788d63a11c719390430b80e93dc33441f20459dd9308b0f30eacd glucofm_encoder.safetensors
|
| 12 |
+
239a03abbc4355ea6324838c521fcb02c03c7d4dc252f0b25badf051564a9f13 LICENSE
|
| 13 |
+
d29ba5c21931c87cb31574c2c2d9c0482c340d9838075227f4b8ace0c5fdf54f PUBLISH.md
|
| 14 |
+
236efdf27f66c322428971838bcfd6d908d3af321438a071aedaf78cd99d2dde README.md
|
config.json
CHANGED
|
@@ -17,14 +17,20 @@
|
|
| 17 |
"delta_minutes": 5.0
|
| 18 |
},
|
| 19 |
"param_counts": {
|
| 20 |
-
"
|
|
|
|
| 21 |
"paper_trainable_full": 732593,
|
| 22 |
"note": "ONNX export omits online/mask_token (128); glucofm infer zeros it by default"
|
| 23 |
},
|
| 24 |
"files": {
|
| 25 |
"safetensors_f32": "glucofm_encoder.safetensors",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
"gguf_f16": "glucofm_encoder.f16.gguf",
|
| 27 |
"gguf_q8": "glucofm_encoder.q8.gguf",
|
|
|
|
| 28 |
"onnx": "glucofm_encoder.onnx",
|
| 29 |
"onnx_meta": "glucofm_encoder.onnx.meta.json"
|
| 30 |
},
|
|
|
|
| 17 |
"delta_minutes": 5.0
|
| 18 |
},
|
| 19 |
"param_counts": {
|
| 20 |
+
"encoder_file_tensors": 435505,
|
| 21 |
+
"encoder_with_mask_token": 435633,
|
| 22 |
"paper_trainable_full": 732593,
|
| 23 |
"note": "ONNX export omits online/mask_token (128); glucofm infer zeros it by default"
|
| 24 |
},
|
| 25 |
"files": {
|
| 26 |
"safetensors_f32": "glucofm_encoder.safetensors",
|
| 27 |
+
"safetensors_f16": "glucofm_encoder.f16.safetensors",
|
| 28 |
+
"rlxp_f32": "glucofm_encoder.rlxp",
|
| 29 |
+
"rlxp_f16": "glucofm_encoder.f16.rlxp",
|
| 30 |
+
"gguf_f32": "glucofm_encoder.f32.gguf",
|
| 31 |
"gguf_f16": "glucofm_encoder.f16.gguf",
|
| 32 |
"gguf_q8": "glucofm_encoder.q8.gguf",
|
| 33 |
+
"bin_glfm": "glucofm_encoder.bin",
|
| 34 |
"onnx": "glucofm_encoder.onnx",
|
| 35 |
"onnx_meta": "glucofm_encoder.onnx.meta.json"
|
| 36 |
},
|
glucofm_encoder.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:35c98270c11f07a3188aeff47eafa4a783bd1d21b197b4ea2759fe9edae010e7
|
| 3 |
+
size 1745050
|
glucofm_encoder.f16.rlxp
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:856634ca98f1d465f5ae376eec10db129b03a81cd94ffb210f0428d5d952dac5
|
| 3 |
+
size 886198
|
glucofm_encoder.f16.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:78a91d83af63f59761ad149ff20aa44403eeaf3580262ccd17931099290497e5
|
| 3 |
+
size 878426
|
glucofm_encoder.f32.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9e92a8c5ba562b25d5b69114447c996f6ec45858aa8bce97b9f3ed1fe3a21c53
|
| 3 |
+
size 1747072
|
glucofm_encoder.rlxp
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e8e3874dd11aced2a930fcce721a477b6558f929007835b9da32f2c6d8453985
|
| 3 |
+
size 1757272
|
glucofm_encoder.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1749540
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f8e0011ef59788d63a11c719390430b80e93dc33441f20459dd9308b0f30eacd
|
| 3 |
size 1749540
|