Skip to main content

dashai-frankenstein

A DashAI plugin that registers Frankenstein Transformer model classes as DashAI components, so end users can train, evaluate, predict, save, and load them from the DashAI UI.

Components registered

Entry point Class DashAI base Binds to task
frankenstein_mlm FrankensteinMLMModel BaseModel TextClassificationTask
frankenstein_decoder FrankensteinDecoderModel BaseGenerativeModel TextToTextGenerationTask (inference only)
frankenstein_pretrainer FrankensteinPretrainer BaseModel MaskedLanguageModelingTask (provided by this plugin)
frankenstein_causal_lm FrankensteinCausalLMModel BaseModel CausalLMPretrainingTask (provided by this plugin)
frankenstein_vit_cls FrankensteinViTClassifier BaseModel ImageClassificationTask
frankenstein_vit_seg FrankensteinViTSegmenter BaseModel SegmentationTask (provided by this plugin)
segmentation_task SegmentationTask BaseTask (new task provided by this plugin)
masked_language_modeling_task MaskedLanguageModelingTask BaseTask (new task provided by this plugin)
causal_lm_pretraining_task CausalLMPretrainingTask BaseTask (new task provided by this plugin)

The use_dashai_dataset checkbox

Every Frankenstein model component exposes a Use DashAI dataset checkbox (default: checked) in its configuration form:

  • Checked (default): training consumes the DashAI run dataset (x_train/y_train) — the dataset section of the Frankenstein JSON, if any, is overridden. Text is tokenized by the plugin's dataset adapters (masking for MLM, plain ids for causal LM, tokenized+labels for classification) and passed to the engine as a pre-built DataLoader.
  • Unchecked: the Frankenstein engine itself loads the corpus from the config pasted in frankenstein_json:
    • NLP tasks (mlm, causal_lm, text_classification) use the text_dataset block (HF hub dataset_name, split, text_column, optional label_column + use_labels, data_dir with parquet/json, streaming, max_samples).
    • Vision tasks use the vision_dataset block (HF dataset_name or local dataset_dir); without either, a dummy smoke dataset is used.

MLM pretraining (Masked Language Modeling)

The FrankensteinPretrainer component runs real BERT-style MLM pre-training (task: mlm in the Frankenstein engine) on a DashAI text dataset:

  1. Create a dataset with a single Text column.
  2. Create a MaskedLanguageModelingTask session and select the same text column as input and output (self-supervised target).
  3. Paste a Frankenstein config (one-line JSON) with tokenizer.name_or_path set — the text is tokenized + 15%-masked at collate time (80% [MASK] / 10% random / 10% keep) and consumed by the engine's TitanTrainer.compute_mlm_loss.

Every optimizer update streams the full telemetry (loss, masked-token accuracy, learning rate, gradient norms per block, GPU temp/power/mem, throughput) into the DashAI run's metric store; the trained backbone is saved via the run's artifact and can be loaded later for classification fine-tuning with FrankensteinMLMModel.

Schema (v1: passthrough JSON)

Each model exposes a minimal pydantic schema with a single user-facing field: frankenstein_json, a string containing a full Frankenstein training config as a single-line JSON. The Frankenstein JSON Schema is the source of truth — the JSON is validated against it (additionalProperties: false + enums) and Frankenstein's config loader (cross-component constraints) before any train/inference launches. Errors surface to the DashAI user as a readable ValueError.

Build your YAML with the Frankenstein YAML builder, convert it to a one-line JSON string, and paste it into the field:

python -c "import yaml,json,sys; print(json.dumps(yaml.safe_load(open(sys.argv[1]))))" my_config.yaml

Training parameters (device, batch_size, num_epochs, learning rate) are read from the config's training_runtime block and optimizer parameters — they are NOT separate DashAI form fields. Generation parameters (max_new_tokens, temperature, top_k) on the decoder component are kept as DashAI fields (they are inference-time, not training-time, and the Frankenstein schema has no home for them).

Note: The field is a single-line text input (DashAI does not yet support a multiline textarea for plugin schema fields), which is why the config is passed as a one-line JSON string rather than a multiline YAML document. A true multiline textarea is tracked as a future upstream improvement to DashAI.

Install

pip install dashai-frankenstein            # from PyPI once published
# or, from this repo:
pip install -e ./dashai-frankenstein

DashAI discovers the plugin via the dashai.plugins entry-points group on startup — no DashAI source edits required.

Architecture

See docs/dashai-plugin-audit.md in the Frankenstein repo for the full integration design (§5 component designs, §6 phased plan, §7 Frankenstein changes). This package is the Phase 1–3 adapter layer; it consumes the Frankenstein engine API (src.engine) added in Phase 0.

Metadata

Release files for dashai-frankenstein 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dashai-frankenstein 0.3.0
File Size Uploaded
dashai_frankenstein-0.3.0.tar.gz 41.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dashai-frankenstein 0.3.0
File Interpreter ABI Platform
dashai_frankenstein-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 91.7 kB

Release files / dashai_frankenstein-0.3.0.tar.gz

Download URL dashai_frankenstein-0.3.0.tar.gz
Size 41.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b28c55276e41752941d97464757e4736f113ecc321e3be6da77934b6fcc3ddf0
BLAKE2b-256 checksum
How to use checksums
558f14f3593ca515d4ffef924d3ddf51829977d4195f4324a13d9afad1196610
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / dashai_frankenstein-0.3.0-py3-none-any.whl

Download URL dashai_frankenstein-0.3.0-py3-none-any.whl
Size 50.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
869aeb16aa05832d6e0fd492797d3bc9dbfe7a7a00e15558e59bce6518302dea
BLAKE2b-256 checksum
How to use checksums
45b444ac20795e3755f40d6d89fe55f4649498d63c648d5279deae64304cab60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page