CoolFace
Modelpublic

yaww85/all-MiniLM-L6-v2-hidden-states-exposed-v1

sourceHugging Faceapache-2.0updated 3mo agoView on Hugging Face
0likes
Model Card

all-MiniLM-L6-v2 — ONNX with All Hidden States

A re-export of sentence-transformers/all-MiniLM-L6-v2 to ONNX format with all intermediate hidden layer outputs exposed.

Changes from the Original

The standard HuggingFace ONNX export only includes last_hidden_state. This export sets output_hidden_states=True and wraps the model to expose all 7 hidden state layers as named outputs:

OutputDescription
last_hidden_stateFinal transformer layer (contextualized embeddings)
hidden_states.0Input embedding layer (static, context-independent)
hidden_states.1 — hidden_states.6Intermediate transformer layers

This enables use cases that require access to both static and contextualized representations — for example, comparing layer-0 embeddings (word identity) against layer-6 embeddings (contextual meaning) for semantic analysis.

Files

FileDescriptionSize
model.onnxONNX model graph (opset 17)~57 KB
model.onnx.dataExternal tensor weights~87 MB
vocab.txtWordPiece vocabulary (30,522 tokens)~227 KB

Export Reproduction

This model was produced by the export script at `bounded_contexts/exocortex/platform/models/minilm/export_minilm.py`:

bash
cd bounded_contexts/exocortex/platform/models/minilm
uv run python export_minilm.py

Attribution

This is a derivative of sentence-transformers/all-MiniLM-L6-v2 by Nils Reimers, licensed under Apache 2.0.

The only modification is the ONNX re-export with all hidden layer outputs enabled. No model weights were altered.