Feature Extraction
Transformers
Safetensors
English
flow_gru
sequence-classification
sandbox
event-sequences
gru
custom_code
Eval Results (legacy)
Instructions to use harpertoken/flow with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use harpertoken/flow with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="harpertoken/flow", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("harpertoken/flow", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language: en
|
| 4 |
+
library_name: transformers
|
| 5 |
+
tags:
|
| 6 |
+
- sequence-classification
|
| 7 |
+
- sandbox
|
| 8 |
+
- event-sequences
|
| 9 |
+
- gru
|
| 10 |
+
datasets:
|
| 11 |
+
- sandbox-lifecycle
|
| 12 |
+
metrics:
|
| 13 |
+
- accuracy
|
| 14 |
+
model-index:
|
| 15 |
+
- name: flow
|
| 16 |
+
results:
|
| 17 |
+
- task:
|
| 18 |
+
type: sequence-classification
|
| 19 |
+
dataset:
|
| 20 |
+
name: sandbox-lifecycle v1ord
|
| 21 |
+
type: sandbox-lifecycle
|
| 22 |
+
split: test
|
| 23 |
+
metrics:
|
| 24 |
+
- type: accuracy
|
| 25 |
+
value: 1.0
|
| 26 |
+
---
|
| 27 |
+
|
| 28 |
+
# flow
|
| 29 |
+
|
| 30 |
+
A GRU classifier over sandbox lifecycle event sequences: eight ordered events in, one of four histories out. Event types embed to 8 dimensions, joined with timestamps and durations into a 32-unit GRU, with a linear head over recover_then_wait, wait_during_outage, delayed_fault and cooldown. Trained for 30 epochs with Adam at learning rate 1e-3, batch size 128, seed 0. Test accuracy 1.0000 on 800 held-out sequences. CPU training.
|
| 31 |
+
|
| 32 |
+
No transformer here. The `PreTrainedModel` wrapper exists only so the weights serialize as `config.json` plus `model.safetensors` and load through `AutoModel` (including `trust_remote_code` via `auto_map`), the same arrangement as the rest of the estate.
|
| 33 |
+
|
| 34 |
+
## The gate this model passed
|
| 35 |
+
|
| 36 |
+
Every sequence carries exactly 8 events with identical type and exit-code bags across labels, and identical final state (exit 0, clean). A field-only MLP on aggregates scores 0.2362 and 0.2537 across two seeds, chance level on four classes. The GRU scores 1.0000 on both seeds. Ordering carries all the signal by construction, and the replication confirms it.
|
| 37 |
+
|
| 38 |
+
## Usage
|
| 39 |
+
|
| 40 |
+
```python
|
| 41 |
+
from transformers import AutoModel
|
| 42 |
+
from modeling_flow import FlowGRU # registers the architecture
|
| 43 |
+
|
| 44 |
+
model = AutoModel.from_pretrained("harpertoken/flow")
|
| 45 |
+
model.eval()
|
| 46 |
+
sequence = [("sandbox_create", 0.0, 0.04), ("execute", 0.04, 0.01)]
|
| 47 |
+
print(model.predict_label(sequence))
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
`predict_label` takes a list of (type, t, duration) triples and returns the history label. Event types must come from the six-value vocabulary; timestamps and durations are seconds. Needs `torch` and `transformers`.
|
| 51 |
+
|
| 52 |
+
## Training
|
| 53 |
+
|
| 54 |
+
4,000 sequences from the v1-ordering collection (1,000 per procedure), split 3,200 train and 800 test by seeded permutation. The seed-0 weights are published; seed 1 replicated at 1.0000 versus 0.2537. The wrapper was checked for exact equivalence against the trained module in eval mode.
|
| 55 |
+
|
| 56 |
+
## Limitations
|
| 57 |
+
|
| 58 |
+
Four controlled histories with identical event multisets. Anything outside that closed vocabulary, longer sequences, new event types, real unsanitized logs, is out of scope. 1.0000 reflects a designed task, not general sandbox understanding.
|