drowse.ai 5.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- drowse/__init__.py +312 -0
- drowse/__main__.py +5 -0
- drowse/cli/__init__.py +5 -0
- drowse/cli/alpha_grid.py +96 -0
- drowse/cli/config_file.py +340 -0
- drowse/cli/main.py +52 -0
- drowse/cli/parsers.py +1478 -0
- drowse/cli/runners/__init__.py +155 -0
- drowse/cli/runners/config.py +85 -0
- drowse/cli/runners/experiment.py +344 -0
- drowse/cli/runners/lens.py +661 -0
- drowse/cli/runners/manifold.py +1097 -0
- drowse/cli/runners/pack.py +413 -0
- drowse/cli/runners/sae.py +304 -0
- drowse/cli/runners/serve.py +220 -0
- drowse/cli/runners/shared.py +389 -0
- drowse/cli/runners/template.py +232 -0
- drowse/core/__init__.py +1 -0
- drowse/core/capture.py +1205 -0
- drowse/core/errors.py +260 -0
- drowse/core/events.py +156 -0
- drowse/core/extraction.py +3076 -0
- drowse/core/generation.py +1738 -0
- drowse/core/generation_finalizer.py +278 -0
- drowse/core/histogram.py +30 -0
- drowse/core/hooks.py +1885 -0
- drowse/core/instruments/__init__.py +49 -0
- drowse/core/instruments/geometry.py +551 -0
- drowse/core/instruments/lens.py +1341 -0
- drowse/core/instruments/protocol.py +211 -0
- drowse/core/instruments/sae.py +935 -0
- drowse/core/instruments/types.py +597 -0
- drowse/core/jlens.py +874 -0
- drowse/core/jlens_fit.py +1305 -0
- drowse/core/joint_logprobs.py +748 -0
- drowse/core/loom.py +1938 -0
- drowse/core/loom_diff.py +408 -0
- drowse/core/mahalanobis.py +579 -0
- drowse/core/manifold.py +4106 -0
- drowse/core/measurements.py +382 -0
- drowse/core/model.py +1724 -0
- drowse/core/monitor.py +2060 -0
- drowse/core/monitor_attach.py +682 -0
- drowse/core/naming.py +42 -0
- drowse/core/naturalness.py +187 -0
- drowse/core/profile.py +617 -0
- drowse/core/relp.py +313 -0
- drowse/core/results.py +467 -0
- drowse/core/role_templates.py +677 -0
- drowse/core/sae.py +891 -0
- drowse/core/sae_training.py +239 -0
- drowse/core/sampling.py +127 -0
- drowse/core/scene.py +810 -0
- drowse/core/scoring.py +270 -0
- drowse/core/session.py +11015 -0
- drowse/core/static_cache.py +316 -0
- drowse/core/steering.py +229 -0
- drowse/core/steering_composer.py +1135 -0
- drowse/core/steering_expr.py +1413 -0
- drowse/core/surface_topology.py +128 -0
- drowse/core/token_callback.py +52 -0
- drowse/core/token_payloads.py +244 -0
- drowse/core/topology.py +1469 -0
- drowse/core/transcript.py +582 -0
- drowse/core/tree_filter.py +353 -0
- drowse/core/triggers.py +250 -0
- drowse/data/baseline_prompts.json +50 -0
- drowse/data/manifolds/confident.uncertain/manifold.json +28 -0
- drowse/data/manifolds/confident.uncertain/nodes/00_confident.json +50 -0
- drowse/data/manifolds/confident.uncertain/nodes/01_uncertain.json +50 -0
- drowse/data/manifolds/creative.conventional/manifold.json +28 -0
- drowse/data/manifolds/creative.conventional/nodes/00_creative.json +50 -0
- drowse/data/manifolds/creative.conventional/nodes/01_conventional.json +50 -0
- drowse/data/manifolds/curious.disinterested/manifold.json +28 -0
- drowse/data/manifolds/curious.disinterested/nodes/00_curious.json +50 -0
- drowse/data/manifolds/curious.disinterested/nodes/01_disinterested.json +50 -0
- drowse/data/manifolds/direct.indirect/manifold.json +28 -0
- drowse/data/manifolds/direct.indirect/nodes/00_direct.json +50 -0
- drowse/data/manifolds/direct.indirect/nodes/01_indirect.json +50 -0
- drowse/data/manifolds/emotions/manifold.json +115 -0
- drowse/data/manifolds/emotions/nodes/00_excited.json +50 -0
- drowse/data/manifolds/emotions/nodes/01_happy.json +50 -0
- drowse/data/manifolds/emotions/nodes/02_calm.json +50 -0
- drowse/data/manifolds/emotions/nodes/03_weary.json +50 -0
- drowse/data/manifolds/emotions/nodes/04_sad.json +50 -0
- drowse/data/manifolds/emotions/nodes/05_distressed.json +50 -0
- drowse/data/manifolds/emotions/nodes/06_alert.json +50 -0
- drowse/data/manifolds/emotions/nodes/07_dominant.json +50 -0
- drowse/data/manifolds/emotions/nodes/08_submissive.json +50 -0
- drowse/data/manifolds/emotions/nodes/09_angry.json +50 -0
- drowse/data/manifolds/emotions/nodes/10_fearful.json +50 -0
- drowse/data/manifolds/emotions/nodes/11_surprised.json +50 -0
- drowse/data/manifolds/emotions/nodes/12_triumphant.json +50 -0
- drowse/data/manifolds/emotions/nodes/13_humiliated.json +50 -0
- drowse/data/manifolds/emotions/nodes/14_disgusted.json +50 -0
- drowse/data/manifolds/emotions/nodes/15_bored.json +50 -0
- drowse/data/manifolds/emotions/nodes/16_grateful.json +50 -0
- drowse/data/manifolds/emotions/nodes/17_relieved.json +50 -0
- drowse/data/manifolds/emotions/nodes/18_playful.json +50 -0
- drowse/data/manifolds/emotions/nodes/19_hopeful.json +50 -0
- drowse/data/manifolds/formal.casual/manifold.json +28 -0
- drowse/data/manifolds/formal.casual/nodes/00_formal.json +50 -0
- drowse/data/manifolds/formal.casual/nodes/01_casual.json +50 -0
- drowse/data/manifolds/honest.deceptive/manifold.json +28 -0
- drowse/data/manifolds/honest.deceptive/nodes/00_honest.json +50 -0
- drowse/data/manifolds/honest.deceptive/nodes/01_deceptive.json +50 -0
- drowse/data/manifolds/humorous.serious/manifold.json +28 -0
- drowse/data/manifolds/humorous.serious/nodes/00_humorous.json +50 -0
- drowse/data/manifolds/humorous.serious/nodes/01_serious.json +50 -0
- drowse/data/manifolds/individualist.collectivist/manifold.json +28 -0
- drowse/data/manifolds/individualist.collectivist/nodes/00_individualist.json +50 -0
- drowse/data/manifolds/individualist.collectivist/nodes/01_collectivist.json +50 -0
- drowse/data/manifolds/masculine.feminine/manifold.json +28 -0
- drowse/data/manifolds/masculine.feminine/nodes/00_masculine.json +50 -0
- drowse/data/manifolds/masculine.feminine/nodes/01_feminine.json +50 -0
- drowse/data/manifolds/months/manifold.json +120 -0
- drowse/data/manifolds/months/nodes/00_january.json +50 -0
- drowse/data/manifolds/months/nodes/01_february.json +50 -0
- drowse/data/manifolds/months/nodes/02_march.json +50 -0
- drowse/data/manifolds/months/nodes/03_april.json +50 -0
- drowse/data/manifolds/months/nodes/04_may.json +50 -0
- drowse/data/manifolds/months/nodes/05_june.json +50 -0
- drowse/data/manifolds/months/nodes/06_july.json +50 -0
- drowse/data/manifolds/months/nodes/07_august.json +50 -0
- drowse/data/manifolds/months/nodes/08_september.json +50 -0
- drowse/data/manifolds/months/nodes/09_october.json +50 -0
- drowse/data/manifolds/months/nodes/10_november.json +50 -0
- drowse/data/manifolds/months/nodes/11_december.json +50 -0
- drowse/data/manifolds/personas/manifold.json +550 -0
- drowse/data/manifolds/personas/nodes/00_assistant.json +50 -0
- drowse/data/manifolds/personas/nodes/01_analyst.json +50 -0
- drowse/data/manifolds/personas/nodes/02_impostor.json +50 -0
- drowse/data/manifolds/personas/nodes/03_teacher.json +50 -0
- drowse/data/manifolds/personas/nodes/04_doctor.json +50 -0
- drowse/data/manifolds/personas/nodes/05_librarian.json +50 -0
- drowse/data/manifolds/personas/nodes/06_farmer.json +50 -0
- drowse/data/manifolds/personas/nodes/07_soldier.json +50 -0
- drowse/data/manifolds/personas/nodes/08_lawyer.json +50 -0
- drowse/data/manifolds/personas/nodes/09_chef.json +50 -0
- drowse/data/manifolds/personas/nodes/100_assassin.json +50 -0
- drowse/data/manifolds/personas/nodes/101_thief.json +50 -0
- drowse/data/manifolds/personas/nodes/102_conman.json +50 -0
- drowse/data/manifolds/personas/nodes/103_hacker.json +50 -0
- drowse/data/manifolds/personas/nodes/104_cultist.json +50 -0
- drowse/data/manifolds/personas/nodes/105_tyrant.json +50 -0
- drowse/data/manifolds/personas/nodes/106_vandal.json +50 -0
- drowse/data/manifolds/personas/nodes/10_journalist.json +50 -0
- drowse/data/manifolds/personas/nodes/11_mechanic.json +50 -0
- drowse/data/manifolds/personas/nodes/12_sailor.json +50 -0
- drowse/data/manifolds/personas/nodes/13_pilot.json +50 -0
- drowse/data/manifolds/personas/nodes/14_athlete.json +50 -0
- drowse/data/manifolds/personas/nodes/15_engineer.json +50 -0
- drowse/data/manifolds/personas/nodes/16_scientist.json +50 -0
- drowse/data/manifolds/personas/nodes/17_banker.json +50 -0
- drowse/data/manifolds/personas/nodes/18_salesperson.json +50 -0
- drowse/data/manifolds/personas/nodes/19_nerd.json +50 -0
- drowse/data/manifolds/personas/nodes/20_jock.json +50 -0
- drowse/data/manifolds/personas/nodes/21_gamer.json +50 -0
- drowse/data/manifolds/personas/nodes/22_furry.json +50 -0
- drowse/data/manifolds/personas/nodes/23_weeaboo.json +50 -0
- drowse/data/manifolds/personas/nodes/24_influencer.json +50 -0
- drowse/data/manifolds/personas/nodes/25_stoner.json +50 -0
- drowse/data/manifolds/personas/nodes/26_femboy.json +50 -0
- drowse/data/manifolds/personas/nodes/27_ceo.json +50 -0
- drowse/data/manifolds/personas/nodes/28_emperor.json +50 -0
- drowse/data/manifolds/personas/nodes/29_president.json +50 -0
- drowse/data/manifolds/personas/nodes/30_diplomat.json +50 -0
- drowse/data/manifolds/personas/nodes/31_judge.json +50 -0
- drowse/data/manifolds/personas/nodes/32_bureaucrat.json +50 -0
- drowse/data/manifolds/personas/nodes/33_conservative.json +50 -0
- drowse/data/manifolds/personas/nodes/34_liberal.json +50 -0
- drowse/data/manifolds/personas/nodes/35_libertarian.json +50 -0
- drowse/data/manifolds/personas/nodes/36_communist.json +50 -0
- drowse/data/manifolds/personas/nodes/37_anarchist.json +50 -0
- drowse/data/manifolds/personas/nodes/38_reactionary.json +50 -0
- drowse/data/manifolds/personas/nodes/39_loner.json +50 -0
- drowse/data/manifolds/personas/nodes/40_friend.json +50 -0
- drowse/data/manifolds/personas/nodes/41_rival.json +50 -0
- drowse/data/manifolds/personas/nodes/42_stranger.json +50 -0
- drowse/data/manifolds/personas/nodes/43_lover.json +50 -0
- drowse/data/manifolds/personas/nodes/44_stalker.json +50 -0
- drowse/data/manifolds/personas/nodes/45_lunatic.json +50 -0
- drowse/data/manifolds/personas/nodes/46_paranoid.json +50 -0
- drowse/data/manifolds/personas/nodes/47_detective.json +50 -0
- drowse/data/manifolds/personas/nodes/48_therapist.json +50 -0
- drowse/data/manifolds/personas/nodes/49_nomad.json +50 -0
- drowse/data/manifolds/personas/nodes/50_pirate.json +50 -0
- drowse/data/manifolds/personas/nodes/51_child.json +50 -0
- drowse/data/manifolds/personas/nodes/52_caveman.json +50 -0
- drowse/data/manifolds/personas/nodes/53_monk.json +50 -0
- drowse/data/manifolds/personas/nodes/54_knight.json +50 -0
- drowse/data/manifolds/personas/nodes/55_alchemist.json +50 -0
- drowse/data/manifolds/personas/nodes/56_blacksmith.json +50 -0
- drowse/data/manifolds/personas/nodes/57_viking.json +50 -0
- drowse/data/manifolds/personas/nodes/58_druid.json +50 -0
- drowse/data/manifolds/personas/nodes/59_poet.json +50 -0
- drowse/data/manifolds/personas/nodes/60_novelist.json +50 -0
- drowse/data/manifolds/personas/nodes/61_jester.json +50 -0
- drowse/data/manifolds/personas/nodes/62_philosopher.json +50 -0
- drowse/data/manifolds/personas/nodes/63_painter.json +50 -0
- drowse/data/manifolds/personas/nodes/64_musician.json +50 -0
- drowse/data/manifolds/personas/nodes/65_oracle.json +50 -0
- drowse/data/manifolds/personas/nodes/66_god.json +50 -0
- drowse/data/manifolds/personas/nodes/67_angel.json +50 -0
- drowse/data/manifolds/personas/nodes/68_prophet.json +50 -0
- drowse/data/manifolds/personas/nodes/69_saint.json +50 -0
- drowse/data/manifolds/personas/nodes/70_ghost.json +50 -0
- drowse/data/manifolds/personas/nodes/71_phoenix.json +50 -0
- drowse/data/manifolds/personas/nodes/72_witch.json +50 -0
- drowse/data/manifolds/personas/nodes/73_vampire.json +50 -0
- drowse/data/manifolds/personas/nodes/74_mermaid.json +50 -0
- drowse/data/manifolds/personas/nodes/75_sphinx.json +50 -0
- drowse/data/manifolds/personas/nodes/76_banshee.json +50 -0
- drowse/data/manifolds/personas/nodes/77_golem.json +50 -0
- drowse/data/manifolds/personas/nodes/78_deer.json +50 -0
- drowse/data/manifolds/personas/nodes/79_wolf.json +50 -0
- drowse/data/manifolds/personas/nodes/80_raven.json +50 -0
- drowse/data/manifolds/personas/nodes/81_serpent.json +50 -0
- drowse/data/manifolds/personas/nodes/82_lion.json +50 -0
- drowse/data/manifolds/personas/nodes/83_tree.json +50 -0
- drowse/data/manifolds/personas/nodes/84_river.json +50 -0
- drowse/data/manifolds/personas/nodes/85_storm.json +50 -0
- drowse/data/manifolds/personas/nodes/86_flame.json +50 -0
- drowse/data/manifolds/personas/nodes/87_mirror.json +50 -0
- drowse/data/manifolds/personas/nodes/88_clock.json +50 -0
- drowse/data/manifolds/personas/nodes/89_computer.json +50 -0
- drowse/data/manifolds/personas/nodes/90_robot.json +50 -0
- drowse/data/manifolds/personas/nodes/91_cyborg.json +50 -0
- drowse/data/manifolds/personas/nodes/92_drone.json +50 -0
- drowse/data/manifolds/personas/nodes/93_mecha.json +50 -0
- drowse/data/manifolds/personas/nodes/94_alien.json +50 -0
- drowse/data/manifolds/personas/nodes/95_trickster.json +50 -0
- drowse/data/manifolds/personas/nodes/96_virus.json +50 -0
- drowse/data/manifolds/personas/nodes/97_spy.json +50 -0
- drowse/data/manifolds/personas/nodes/98_narcissist.json +50 -0
- drowse/data/manifolds/personas/nodes/99_demon.json +50 -0
- drowse/data/manifolds/refusing.compliant/manifold.json +28 -0
- drowse/data/manifolds/refusing.compliant/nodes/00_refusing.json +50 -0
- drowse/data/manifolds/refusing.compliant/nodes/01_compliant.json +50 -0
- drowse/data/manifolds/religious.secular/manifold.json +28 -0
- drowse/data/manifolds/religious.secular/nodes/00_religious.json +50 -0
- drowse/data/manifolds/religious.secular/nodes/01_secular.json +50 -0
- drowse/data/manifolds/sincere.manipulative/manifold.json +28 -0
- drowse/data/manifolds/sincere.manipulative/nodes/00_sincere.json +50 -0
- drowse/data/manifolds/sincere.manipulative/nodes/01_manipulative.json +50 -0
- drowse/data/manifolds/sycophantic.blunt/manifold.json +28 -0
- drowse/data/manifolds/sycophantic.blunt/nodes/00_sycophantic.json +50 -0
- drowse/data/manifolds/sycophantic.blunt/nodes/01_blunt.json +50 -0
- drowse/data/manifolds/technical.accessible/manifold.json +28 -0
- drowse/data/manifolds/technical.accessible/nodes/00_technical.json +50 -0
- drowse/data/manifolds/technical.accessible/nodes/01_accessible.json +50 -0
- drowse/data/manifolds/traditional.progressive/manifold.json +28 -0
- drowse/data/manifolds/traditional.progressive/nodes/00_traditional.json +50 -0
- drowse/data/manifolds/traditional.progressive/nodes/01_progressive.json +50 -0
- drowse/data/manifolds/verbose.concise/manifold.json +28 -0
- drowse/data/manifolds/verbose.concise/nodes/00_verbose.json +50 -0
- drowse/data/manifolds/verbose.concise/nodes/01_concise.json +50 -0
- drowse/data/manifolds/warm.clinical/manifold.json +28 -0
- drowse/data/manifolds/warm.clinical/nodes/00_warm.json +50 -0
- drowse/data/manifolds/warm.clinical/nodes/01_clinical.json +50 -0
- drowse/data/neutral_statements.json +98 -0
- drowse/io/__init__.py +1 -0
- drowse/io/alignment.py +1334 -0
- drowse/io/atomic.py +278 -0
- drowse/io/bake.py +558 -0
- drowse/io/bootstrap.py +73 -0
- drowse/io/brand_migration.py +48 -0
- drowse/io/drowse_archive.py +1830 -0
- drowse/io/gguf_io.py +300 -0
- drowse/io/hf.py +81 -0
- drowse/io/hf_manifolds.py +931 -0
- drowse/io/integrity.py +102 -0
- drowse/io/lens.py +1992 -0
- drowse/io/lens_sources.py +1003 -0
- drowse/io/manifold_authoring.py +1348 -0
- drowse/io/manifold_folder.py +1854 -0
- drowse/io/manifold_lifecycle.py +1253 -0
- drowse/io/manifold_tensors.py +727 -0
- drowse/io/manifolds.py +443 -0
- drowse/io/paths.py +289 -0
- drowse/io/probes_bootstrap.py +58 -0
- drowse/io/sae.py +382 -0
- drowse/io/sae_artifacts.py +318 -0
- drowse/io/selectors.py +503 -0
- drowse/io/shards.py +160 -0
- drowse/io/source_registry.py +138 -0
- drowse/io/staging.py +80 -0
- drowse/io/templates.py +707 -0
- drowse/notebook/__init__.py +38 -0
- drowse/notebook/data.py +99 -0
- drowse/notebook/plots.py +352 -0
- drowse/py.typed +0 -0
- drowse/server/__init__.py +20 -0
- drowse/server/app.py +987 -0
- drowse/server/background_job.py +246 -0
- drowse/server/instrument_routes.py +1101 -0
- drowse/server/manifold_routes.py +1028 -0
- drowse/server/model_names.py +82 -0
- drowse/server/native_common.py +92 -0
- drowse/server/native_routes.py +45 -0
- drowse/server/ollama.py +817 -0
- drowse/server/operation_ledger.py +187 -0
- drowse/server/probe_routes.py +220 -0
- drowse/server/profile_models.py +52 -0
- drowse/server/profile_routes.py +440 -0
- drowse/server/request_helpers.py +198 -0
- drowse/server/request_ledger.py +85 -0
- drowse/server/response_models.py +814 -0
- drowse/server/session_models.py +146 -0
- drowse/server/session_routes.py +150 -0
- drowse/server/sse.py +333 -0
- drowse/server/streaming.py +129 -0
- drowse/server/template_routes.py +161 -0
- drowse/server/tree_models.py +121 -0
- drowse/server/tree_routes.py +550 -0
- drowse/server/ws_events.py +65 -0
- drowse/server/ws_models.py +219 -0
- drowse/server/ws_stream.py +1205 -0
- drowse/web/__init__.py +22 -0
- drowse/web/dist/LICENSE-Fluent-Icons.txt +21 -0
- drowse/web/dist/LICENSE-Fluent-System-Icons.txt +21 -0
- drowse/web/dist/LICENSE-Martian-Mono.txt +93 -0
- drowse/web/dist/LICENSE-Torph.txt +21 -0
- drowse/web/dist/LICENSE-Wix-Madefor.txt +93 -0
- drowse/web/dist/assets/App-BewwoFwv.js +33 -0
- drowse/web/dist/assets/App.css +1 -0
- drowse/web/dist/assets/MartianMono-cyrillic-ext.woff2 +0 -0
- drowse/web/dist/assets/MartianMono-cyrillic.woff2 +0 -0
- drowse/web/dist/assets/MartianMono-latin-ext.woff2 +0 -0
- drowse/web/dist/assets/MartianMono-latin.woff2 +0 -0
- drowse/web/dist/assets/WixMadeforDisplay-cyrillic.woff2 +0 -0
- drowse/web/dist/assets/WixMadeforDisplay-latin-ext.woff2 +0 -0
- drowse/web/dist/assets/WixMadeforDisplay-latin.woff2 +0 -0
- drowse/web/dist/assets/WixMadeforDisplay-vietnamese.woff2 +0 -0
- drowse/web/dist/assets/WixMadeforText-italic-latin-ext.woff2 +0 -0
- drowse/web/dist/assets/WixMadeforText-italic-latin.woff2 +0 -0
- drowse/web/dist/assets/WixMadeforText-normal-cyrillic.woff2 +0 -0
- drowse/web/dist/assets/WixMadeforText-normal-latin-ext.woff2 +0 -0
- drowse/web/dist/assets/WixMadeforText-normal-latin.woff2 +0 -0
- drowse/web/dist/assets/WixMadeforText-normal-vietnamese.woff2 +0 -0
- drowse/web/dist/assets/ab.svelte-CbVGAYXo.js +1 -0
- drowse/web/dist/assets/artifactUpdates-Cjeu6LJc.js +1 -0
- drowse/web/dist/assets/artifactUpdates-DfAoYC9j.js +1 -0
- drowse/web/dist/assets/chat.svelte-DxKufn9g.js +1 -0
- drowse/web/dist/assets/drawers-BDWC0hIN.js +123 -0
- drowse/web/dist/assets/drawers.css +1 -0
- drowse/web/dist/assets/drowse.js +7 -0
- drowse/web/dist/assets/eleutherai.png +0 -0
- drowse/web/dist/assets/errors-Dvb10QW_.js +2 -0
- drowse/web/dist/assets/expression-4yISdAdq.js +1 -0
- drowse/web/dist/assets/files-CvRivkey.js +1 -0
- drowse/web/dist/assets/files-JhDJVgD_.js +1 -0
- drowse/web/dist/assets/fittingCancellation-D72BZWPZ.js +1 -0
- drowse/web/dist/assets/gemma-3-1b-it.json +1 -0
- drowse/web/dist/assets/gemma-3-270m-it.json +1 -0
- drowse/web/dist/assets/gemma-3-4b-it.json +1 -0
- drowse/web/dist/assets/generation-DbkBAhP_.js +1 -0
- drowse/web/dist/assets/index-client-2OdH6IQp.js +3 -0
- drowse/web/dist/assets/index-client-D4S4PooY.js +1 -0
- drowse/web/dist/assets/index.css +1 -0
- drowse/web/dist/assets/instrumentAuthoring.svelte-Csh7NOGX.js +1 -0
- drowse/web/dist/assets/instrumentAuthoring.svelte-w9YPcDsP.js +1 -0
- drowse/web/dist/assets/instruments.svelte-XnEUQA6B.js +1 -0
- drowse/web/dist/assets/localData-DIBDM_zo.js +1 -0
- drowse/web/dist/assets/loom.svelte-D_YyqHHK.js +1 -0
- drowse/web/dist/assets/manifoldJobs.svelte-9f5hs_J7.js +1 -0
- drowse/web/dist/assets/manifoldJobs.svelte-Bwo2GYOH.js +1 -0
- drowse/web/dist/assets/openai.png +0 -0
- drowse/web/dist/assets/preload-helper-BLdHbfdN.js +1 -0
- drowse/web/dist/assets/probes.svelte-COcN1Rh8.js +1 -0
- drowse/web/dist/assets/registry-B0_pJoMg.js +1 -0
- drowse/web/dist/assets/registry-CQv71XNh.js +1 -0
- drowse/web/dist/assets/sampling.svelte-BU0kED3k.js +1 -0
- drowse/web/dist/assets/samplingCapabilities-DM6eoDoc.js +1 -0
- drowse/web/dist/assets/savedConversations.svelte-BsBLc-p7.js +1 -0
- drowse/web/dist/assets/savedConversations.svelte-TuSes9Kg.js +1 -0
- drowse/web/dist/assets/selectors-BxXnPPN_.js +1 -0
- drowse/web/dist/assets/serviceTools-CG0q1Xqg.js +2 -0
- drowse/web/dist/assets/session.svelte-D2STLuP6.js +1 -0
- drowse/web/dist/assets/steering.svelte-DvFT3O-d.js +1 -0
- drowse/web/dist/assets/steeringPositions-Dr0JOFu7.js +1 -0
- drowse/web/dist/assets/templates-Bkq2x5ID.js +1 -0
- drowse/web/dist/assets/types-CuMUbvHW.js +1 -0
- drowse/web/dist/assets/validation-5wgTuS7k.js +1 -0
- drowse/web/dist/assets/webmcp-DyqJf4z6.js +2 -0
- drowse/web/dist/assets/workspaceController-C2L33e3m.js +1 -0
- drowse/web/dist/assets/workspaceController-DJhXD_BC.js +1 -0
- drowse/web/dist/assets/workspaceTools-BWdmXopx.js +2 -0
- drowse/web/dist/favicon.ico +0 -0
- drowse/web/dist/favicon.svg +1 -0
- drowse/web/dist/icons/apple-touch-icon.png +0 -0
- drowse/web/dist/icons/drowse-192.png +0 -0
- drowse/web/dist/icons/drowse-512.png +0 -0
- drowse/web/dist/icons/drowse-maskable-512.png +0 -0
- drowse/web/dist/icons/tab-analyzing-0.png +0 -0
- drowse/web/dist/icons/tab-analyzing-1.png +0 -0
- drowse/web/dist/icons/tab-analyzing-2.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-0.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-1.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-10.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-11.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-12.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-13.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-14.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-15.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-16.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-17.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-18.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-19.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-2.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-20.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-21.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-22.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-23.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-24.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-25.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-26.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-27.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-28.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-29.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-3.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-30.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-31.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-32.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-33.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-34.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-35.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-36.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-37.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-38.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-39.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-4.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-40.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-41.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-42.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-43.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-44.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-45.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-46.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-47.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-5.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-6.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-7.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-8.png +0 -0
- drowse/web/dist/icons/tab-analyzing-dark-9.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-0.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-1.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-10.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-11.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-12.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-13.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-14.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-15.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-16.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-17.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-18.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-19.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-2.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-20.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-21.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-22.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-23.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-24.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-25.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-26.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-27.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-28.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-29.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-3.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-30.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-31.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-32.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-33.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-34.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-35.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-36.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-37.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-38.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-39.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-4.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-40.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-41.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-42.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-43.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-44.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-45.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-46.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-47.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-5.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-6.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-7.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-8.png +0 -0
- drowse/web/dist/icons/tab-analyzing-light-9.png +0 -0
- drowse/web/dist/icons/tab-chat-settings-dark.png +0 -0
- drowse/web/dist/icons/tab-chat-settings-light.png +0 -0
- drowse/web/dist/icons/tab-chat-settings.png +0 -0
- drowse/web/dist/icons/tab-chats-dark.png +0 -0
- drowse/web/dist/icons/tab-chats-light.png +0 -0
- drowse/web/dist/icons/tab-chats.png +0 -0
- drowse/web/dist/icons/tab-checking-0.png +0 -0
- drowse/web/dist/icons/tab-checking-1.png +0 -0
- drowse/web/dist/icons/tab-checking-2.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-0.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-1.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-10.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-11.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-12.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-13.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-14.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-15.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-16.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-17.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-18.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-19.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-2.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-20.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-21.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-22.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-23.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-24.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-25.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-26.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-27.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-28.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-29.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-3.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-30.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-31.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-32.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-33.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-34.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-35.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-36.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-37.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-38.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-39.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-4.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-40.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-41.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-42.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-43.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-44.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-45.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-46.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-47.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-5.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-6.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-7.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-8.png +0 -0
- drowse/web/dist/icons/tab-checking-dark-9.png +0 -0
- drowse/web/dist/icons/tab-checking-light-0.png +0 -0
- drowse/web/dist/icons/tab-checking-light-1.png +0 -0
- drowse/web/dist/icons/tab-checking-light-10.png +0 -0
- drowse/web/dist/icons/tab-checking-light-11.png +0 -0
- drowse/web/dist/icons/tab-checking-light-12.png +0 -0
- drowse/web/dist/icons/tab-checking-light-13.png +0 -0
- drowse/web/dist/icons/tab-checking-light-14.png +0 -0
- drowse/web/dist/icons/tab-checking-light-15.png +0 -0
- drowse/web/dist/icons/tab-checking-light-16.png +0 -0
- drowse/web/dist/icons/tab-checking-light-17.png +0 -0
- drowse/web/dist/icons/tab-checking-light-18.png +0 -0
- drowse/web/dist/icons/tab-checking-light-19.png +0 -0
- drowse/web/dist/icons/tab-checking-light-2.png +0 -0
- drowse/web/dist/icons/tab-checking-light-20.png +0 -0
- drowse/web/dist/icons/tab-checking-light-21.png +0 -0
- drowse/web/dist/icons/tab-checking-light-22.png +0 -0
- drowse/web/dist/icons/tab-checking-light-23.png +0 -0
- drowse/web/dist/icons/tab-checking-light-24.png +0 -0
- drowse/web/dist/icons/tab-checking-light-25.png +0 -0
- drowse/web/dist/icons/tab-checking-light-26.png +0 -0
- drowse/web/dist/icons/tab-checking-light-27.png +0 -0
- drowse/web/dist/icons/tab-checking-light-28.png +0 -0
- drowse/web/dist/icons/tab-checking-light-29.png +0 -0
- drowse/web/dist/icons/tab-checking-light-3.png +0 -0
- drowse/web/dist/icons/tab-checking-light-30.png +0 -0
- drowse/web/dist/icons/tab-checking-light-31.png +0 -0
- drowse/web/dist/icons/tab-checking-light-32.png +0 -0
- drowse/web/dist/icons/tab-checking-light-33.png +0 -0
- drowse/web/dist/icons/tab-checking-light-34.png +0 -0
- drowse/web/dist/icons/tab-checking-light-35.png +0 -0
- drowse/web/dist/icons/tab-checking-light-36.png +0 -0
- drowse/web/dist/icons/tab-checking-light-37.png +0 -0
- drowse/web/dist/icons/tab-checking-light-38.png +0 -0
- drowse/web/dist/icons/tab-checking-light-39.png +0 -0
- drowse/web/dist/icons/tab-checking-light-4.png +0 -0
- drowse/web/dist/icons/tab-checking-light-40.png +0 -0
- drowse/web/dist/icons/tab-checking-light-41.png +0 -0
- drowse/web/dist/icons/tab-checking-light-42.png +0 -0
- drowse/web/dist/icons/tab-checking-light-43.png +0 -0
- drowse/web/dist/icons/tab-checking-light-44.png +0 -0
- drowse/web/dist/icons/tab-checking-light-45.png +0 -0
- drowse/web/dist/icons/tab-checking-light-46.png +0 -0
- drowse/web/dist/icons/tab-checking-light-47.png +0 -0
- drowse/web/dist/icons/tab-checking-light-5.png +0 -0
- drowse/web/dist/icons/tab-checking-light-6.png +0 -0
- drowse/web/dist/icons/tab-checking-light-7.png +0 -0
- drowse/web/dist/icons/tab-checking-light-8.png +0 -0
- drowse/web/dist/icons/tab-checking-light-9.png +0 -0
- drowse/web/dist/icons/tab-comparison-dark.png +0 -0
- drowse/web/dist/icons/tab-comparison-light.png +0 -0
- drowse/web/dist/icons/tab-comparison.png +0 -0
- drowse/web/dist/icons/tab-controls-dark.png +0 -0
- drowse/web/dist/icons/tab-controls-light.png +0 -0
- drowse/web/dist/icons/tab-controls.png +0 -0
- drowse/web/dist/icons/tab-conversation-dark.png +0 -0
- drowse/web/dist/icons/tab-conversation-light.png +0 -0
- drowse/web/dist/icons/tab-conversation.png +0 -0
- drowse/web/dist/icons/tab-credits-dark.png +0 -0
- drowse/web/dist/icons/tab-credits-light.png +0 -0
- drowse/web/dist/icons/tab-credits.png +0 -0
- drowse/web/dist/icons/tab-downloading-0.png +0 -0
- drowse/web/dist/icons/tab-downloading-1.png +0 -0
- drowse/web/dist/icons/tab-downloading-2.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-0.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-1.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-10.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-11.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-12.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-13.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-14.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-15.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-16.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-17.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-18.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-19.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-2.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-20.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-21.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-22.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-23.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-24.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-25.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-26.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-27.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-28.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-29.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-3.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-30.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-31.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-32.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-33.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-34.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-35.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-36.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-37.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-38.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-39.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-4.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-40.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-41.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-42.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-43.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-44.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-45.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-46.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-47.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-5.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-6.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-7.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-8.png +0 -0
- drowse/web/dist/icons/tab-downloading-dark-9.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-0.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-1.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-10.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-11.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-12.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-13.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-14.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-15.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-16.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-17.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-18.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-19.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-2.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-20.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-21.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-22.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-23.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-24.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-25.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-26.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-27.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-28.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-29.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-3.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-30.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-31.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-32.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-33.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-34.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-35.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-36.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-37.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-38.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-39.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-4.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-40.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-41.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-42.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-43.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-44.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-45.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-46.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-47.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-5.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-6.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-7.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-8.png +0 -0
- drowse/web/dist/icons/tab-downloading-light-9.png +0 -0
- drowse/web/dist/icons/tab-error-dark.png +0 -0
- drowse/web/dist/icons/tab-error-light.png +0 -0
- drowse/web/dist/icons/tab-error.png +0 -0
- drowse/web/dist/icons/tab-home-dark.png +0 -0
- drowse/web/dist/icons/tab-home-light.png +0 -0
- drowse/web/dist/icons/tab-home.png +0 -0
- drowse/web/dist/icons/tab-loading-0.png +0 -0
- drowse/web/dist/icons/tab-loading-1.png +0 -0
- drowse/web/dist/icons/tab-loading-2.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-0.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-1.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-10.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-11.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-12.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-13.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-14.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-15.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-16.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-17.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-18.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-19.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-2.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-20.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-21.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-22.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-23.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-24.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-25.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-26.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-27.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-28.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-29.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-3.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-30.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-31.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-32.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-33.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-34.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-35.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-36.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-37.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-38.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-39.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-4.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-40.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-41.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-42.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-43.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-44.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-45.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-46.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-47.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-5.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-6.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-7.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-8.png +0 -0
- drowse/web/dist/icons/tab-loading-dark-9.png +0 -0
- drowse/web/dist/icons/tab-loading-light-0.png +0 -0
- drowse/web/dist/icons/tab-loading-light-1.png +0 -0
- drowse/web/dist/icons/tab-loading-light-10.png +0 -0
- drowse/web/dist/icons/tab-loading-light-11.png +0 -0
- drowse/web/dist/icons/tab-loading-light-12.png +0 -0
- drowse/web/dist/icons/tab-loading-light-13.png +0 -0
- drowse/web/dist/icons/tab-loading-light-14.png +0 -0
- drowse/web/dist/icons/tab-loading-light-15.png +0 -0
- drowse/web/dist/icons/tab-loading-light-16.png +0 -0
- drowse/web/dist/icons/tab-loading-light-17.png +0 -0
- drowse/web/dist/icons/tab-loading-light-18.png +0 -0
- drowse/web/dist/icons/tab-loading-light-19.png +0 -0
- drowse/web/dist/icons/tab-loading-light-2.png +0 -0
- drowse/web/dist/icons/tab-loading-light-20.png +0 -0
- drowse/web/dist/icons/tab-loading-light-21.png +0 -0
- drowse/web/dist/icons/tab-loading-light-22.png +0 -0
- drowse/web/dist/icons/tab-loading-light-23.png +0 -0
- drowse/web/dist/icons/tab-loading-light-24.png +0 -0
- drowse/web/dist/icons/tab-loading-light-25.png +0 -0
- drowse/web/dist/icons/tab-loading-light-26.png +0 -0
- drowse/web/dist/icons/tab-loading-light-27.png +0 -0
- drowse/web/dist/icons/tab-loading-light-28.png +0 -0
- drowse/web/dist/icons/tab-loading-light-29.png +0 -0
- drowse/web/dist/icons/tab-loading-light-3.png +0 -0
- drowse/web/dist/icons/tab-loading-light-30.png +0 -0
- drowse/web/dist/icons/tab-loading-light-31.png +0 -0
- drowse/web/dist/icons/tab-loading-light-32.png +0 -0
- drowse/web/dist/icons/tab-loading-light-33.png +0 -0
- drowse/web/dist/icons/tab-loading-light-34.png +0 -0
- drowse/web/dist/icons/tab-loading-light-35.png +0 -0
- drowse/web/dist/icons/tab-loading-light-36.png +0 -0
- drowse/web/dist/icons/tab-loading-light-37.png +0 -0
- drowse/web/dist/icons/tab-loading-light-38.png +0 -0
- drowse/web/dist/icons/tab-loading-light-39.png +0 -0
- drowse/web/dist/icons/tab-loading-light-4.png +0 -0
- drowse/web/dist/icons/tab-loading-light-40.png +0 -0
- drowse/web/dist/icons/tab-loading-light-41.png +0 -0
- drowse/web/dist/icons/tab-loading-light-42.png +0 -0
- drowse/web/dist/icons/tab-loading-light-43.png +0 -0
- drowse/web/dist/icons/tab-loading-light-44.png +0 -0
- drowse/web/dist/icons/tab-loading-light-45.png +0 -0
- drowse/web/dist/icons/tab-loading-light-46.png +0 -0
- drowse/web/dist/icons/tab-loading-light-47.png +0 -0
- drowse/web/dist/icons/tab-loading-light-5.png +0 -0
- drowse/web/dist/icons/tab-loading-light-6.png +0 -0
- drowse/web/dist/icons/tab-loading-light-7.png +0 -0
- drowse/web/dist/icons/tab-loading-light-8.png +0 -0
- drowse/web/dist/icons/tab-loading-light-9.png +0 -0
- drowse/web/dist/icons/tab-loom-dark.png +0 -0
- drowse/web/dist/icons/tab-loom-light.png +0 -0
- drowse/web/dist/icons/tab-loom-working-0.png +0 -0
- drowse/web/dist/icons/tab-loom-working-1.png +0 -0
- drowse/web/dist/icons/tab-loom-working-2.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-0.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-1.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-10.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-11.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-12.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-13.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-14.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-15.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-16.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-17.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-18.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-19.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-2.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-20.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-21.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-22.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-23.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-24.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-25.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-26.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-27.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-28.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-29.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-3.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-30.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-31.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-32.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-33.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-34.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-35.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-36.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-37.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-38.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-39.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-4.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-40.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-41.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-42.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-43.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-44.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-45.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-46.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-47.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-5.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-6.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-7.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-8.png +0 -0
- drowse/web/dist/icons/tab-loom-working-dark-9.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-0.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-1.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-10.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-11.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-12.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-13.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-14.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-15.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-16.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-17.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-18.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-19.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-2.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-20.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-21.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-22.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-23.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-24.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-25.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-26.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-27.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-28.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-29.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-3.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-30.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-31.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-32.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-33.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-34.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-35.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-36.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-37.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-38.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-39.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-4.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-40.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-41.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-42.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-43.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-44.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-45.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-46.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-47.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-5.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-6.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-7.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-8.png +0 -0
- drowse/web/dist/icons/tab-loom-working-light-9.png +0 -0
- drowse/web/dist/icons/tab-loom.png +0 -0
- drowse/web/dist/icons/tab-models-dark.png +0 -0
- drowse/web/dist/icons/tab-models-light.png +0 -0
- drowse/web/dist/icons/tab-models.png +0 -0
- drowse/web/dist/icons/tab-offline-dark.png +0 -0
- drowse/web/dist/icons/tab-offline-light.png +0 -0
- drowse/web/dist/icons/tab-offline.png +0 -0
- drowse/web/dist/icons/tab-paused-dark.png +0 -0
- drowse/web/dist/icons/tab-paused-light.png +0 -0
- drowse/web/dist/icons/tab-paused.png +0 -0
- drowse/web/dist/icons/tab-ready-dark.png +0 -0
- drowse/web/dist/icons/tab-ready-light.png +0 -0
- drowse/web/dist/icons/tab-ready.png +0 -0
- drowse/web/dist/icons/tab-saving-0.png +0 -0
- drowse/web/dist/icons/tab-saving-1.png +0 -0
- drowse/web/dist/icons/tab-saving-2.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-0.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-1.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-10.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-11.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-12.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-13.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-14.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-15.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-16.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-17.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-18.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-19.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-2.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-20.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-21.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-22.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-23.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-24.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-25.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-26.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-27.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-28.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-29.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-3.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-30.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-31.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-32.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-33.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-34.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-35.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-36.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-37.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-38.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-39.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-4.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-40.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-41.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-42.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-43.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-44.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-45.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-46.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-47.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-5.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-6.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-7.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-8.png +0 -0
- drowse/web/dist/icons/tab-saving-dark-9.png +0 -0
- drowse/web/dist/icons/tab-saving-light-0.png +0 -0
- drowse/web/dist/icons/tab-saving-light-1.png +0 -0
- drowse/web/dist/icons/tab-saving-light-10.png +0 -0
- drowse/web/dist/icons/tab-saving-light-11.png +0 -0
- drowse/web/dist/icons/tab-saving-light-12.png +0 -0
- drowse/web/dist/icons/tab-saving-light-13.png +0 -0
- drowse/web/dist/icons/tab-saving-light-14.png +0 -0
- drowse/web/dist/icons/tab-saving-light-15.png +0 -0
- drowse/web/dist/icons/tab-saving-light-16.png +0 -0
- drowse/web/dist/icons/tab-saving-light-17.png +0 -0
- drowse/web/dist/icons/tab-saving-light-18.png +0 -0
- drowse/web/dist/icons/tab-saving-light-19.png +0 -0
- drowse/web/dist/icons/tab-saving-light-2.png +0 -0
- drowse/web/dist/icons/tab-saving-light-20.png +0 -0
- drowse/web/dist/icons/tab-saving-light-21.png +0 -0
- drowse/web/dist/icons/tab-saving-light-22.png +0 -0
- drowse/web/dist/icons/tab-saving-light-23.png +0 -0
- drowse/web/dist/icons/tab-saving-light-24.png +0 -0
- drowse/web/dist/icons/tab-saving-light-25.png +0 -0
- drowse/web/dist/icons/tab-saving-light-26.png +0 -0
- drowse/web/dist/icons/tab-saving-light-27.png +0 -0
- drowse/web/dist/icons/tab-saving-light-28.png +0 -0
- drowse/web/dist/icons/tab-saving-light-29.png +0 -0
- drowse/web/dist/icons/tab-saving-light-3.png +0 -0
- drowse/web/dist/icons/tab-saving-light-30.png +0 -0
- drowse/web/dist/icons/tab-saving-light-31.png +0 -0
- drowse/web/dist/icons/tab-saving-light-32.png +0 -0
- drowse/web/dist/icons/tab-saving-light-33.png +0 -0
- drowse/web/dist/icons/tab-saving-light-34.png +0 -0
- drowse/web/dist/icons/tab-saving-light-35.png +0 -0
- drowse/web/dist/icons/tab-saving-light-36.png +0 -0
- drowse/web/dist/icons/tab-saving-light-37.png +0 -0
- drowse/web/dist/icons/tab-saving-light-38.png +0 -0
- drowse/web/dist/icons/tab-saving-light-39.png +0 -0
- drowse/web/dist/icons/tab-saving-light-4.png +0 -0
- drowse/web/dist/icons/tab-saving-light-40.png +0 -0
- drowse/web/dist/icons/tab-saving-light-41.png +0 -0
- drowse/web/dist/icons/tab-saving-light-42.png +0 -0
- drowse/web/dist/icons/tab-saving-light-43.png +0 -0
- drowse/web/dist/icons/tab-saving-light-44.png +0 -0
- drowse/web/dist/icons/tab-saving-light-45.png +0 -0
- drowse/web/dist/icons/tab-saving-light-46.png +0 -0
- drowse/web/dist/icons/tab-saving-light-47.png +0 -0
- drowse/web/dist/icons/tab-saving-light-5.png +0 -0
- drowse/web/dist/icons/tab-saving-light-6.png +0 -0
- drowse/web/dist/icons/tab-saving-light-7.png +0 -0
- drowse/web/dist/icons/tab-saving-light-8.png +0 -0
- drowse/web/dist/icons/tab-saving-light-9.png +0 -0
- drowse/web/dist/icons/tab-thinking-0.png +0 -0
- drowse/web/dist/icons/tab-thinking-1.png +0 -0
- drowse/web/dist/icons/tab-thinking-2.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-0.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-1.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-10.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-11.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-12.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-13.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-14.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-15.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-16.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-17.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-18.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-19.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-2.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-20.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-21.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-22.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-23.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-24.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-25.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-26.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-27.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-28.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-29.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-3.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-30.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-31.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-32.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-33.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-34.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-35.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-36.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-37.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-38.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-39.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-4.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-40.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-41.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-42.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-43.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-44.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-45.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-46.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-47.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-5.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-6.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-7.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-8.png +0 -0
- drowse/web/dist/icons/tab-thinking-dark-9.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-0.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-1.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-10.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-11.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-12.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-13.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-14.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-15.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-16.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-17.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-18.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-19.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-2.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-20.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-21.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-22.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-23.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-24.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-25.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-26.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-27.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-28.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-29.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-3.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-30.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-31.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-32.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-33.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-34.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-35.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-36.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-37.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-38.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-39.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-4.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-40.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-41.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-42.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-43.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-44.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-45.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-46.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-47.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-5.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-6.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-7.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-8.png +0 -0
- drowse/web/dist/icons/tab-thinking-light-9.png +0 -0
- drowse/web/dist/icons/tab-tokens-dark.png +0 -0
- drowse/web/dist/icons/tab-tokens-light.png +0 -0
- drowse/web/dist/icons/tab-tokens.png +0 -0
- drowse/web/dist/icons/tab-training-0.png +0 -0
- drowse/web/dist/icons/tab-training-1.png +0 -0
- drowse/web/dist/icons/tab-training-2.png +0 -0
- drowse/web/dist/icons/tab-training-dark-0.png +0 -0
- drowse/web/dist/icons/tab-training-dark-1.png +0 -0
- drowse/web/dist/icons/tab-training-dark-10.png +0 -0
- drowse/web/dist/icons/tab-training-dark-11.png +0 -0
- drowse/web/dist/icons/tab-training-dark-12.png +0 -0
- drowse/web/dist/icons/tab-training-dark-13.png +0 -0
- drowse/web/dist/icons/tab-training-dark-14.png +0 -0
- drowse/web/dist/icons/tab-training-dark-15.png +0 -0
- drowse/web/dist/icons/tab-training-dark-16.png +0 -0
- drowse/web/dist/icons/tab-training-dark-17.png +0 -0
- drowse/web/dist/icons/tab-training-dark-18.png +0 -0
- drowse/web/dist/icons/tab-training-dark-19.png +0 -0
- drowse/web/dist/icons/tab-training-dark-2.png +0 -0
- drowse/web/dist/icons/tab-training-dark-20.png +0 -0
- drowse/web/dist/icons/tab-training-dark-21.png +0 -0
- drowse/web/dist/icons/tab-training-dark-22.png +0 -0
- drowse/web/dist/icons/tab-training-dark-23.png +0 -0
- drowse/web/dist/icons/tab-training-dark-24.png +0 -0
- drowse/web/dist/icons/tab-training-dark-25.png +0 -0
- drowse/web/dist/icons/tab-training-dark-26.png +0 -0
- drowse/web/dist/icons/tab-training-dark-27.png +0 -0
- drowse/web/dist/icons/tab-training-dark-28.png +0 -0
- drowse/web/dist/icons/tab-training-dark-29.png +0 -0
- drowse/web/dist/icons/tab-training-dark-3.png +0 -0
- drowse/web/dist/icons/tab-training-dark-30.png +0 -0
- drowse/web/dist/icons/tab-training-dark-31.png +0 -0
- drowse/web/dist/icons/tab-training-dark-32.png +0 -0
- drowse/web/dist/icons/tab-training-dark-33.png +0 -0
- drowse/web/dist/icons/tab-training-dark-34.png +0 -0
- drowse/web/dist/icons/tab-training-dark-35.png +0 -0
- drowse/web/dist/icons/tab-training-dark-36.png +0 -0
- drowse/web/dist/icons/tab-training-dark-37.png +0 -0
- drowse/web/dist/icons/tab-training-dark-38.png +0 -0
- drowse/web/dist/icons/tab-training-dark-39.png +0 -0
- drowse/web/dist/icons/tab-training-dark-4.png +0 -0
- drowse/web/dist/icons/tab-training-dark-40.png +0 -0
- drowse/web/dist/icons/tab-training-dark-41.png +0 -0
- drowse/web/dist/icons/tab-training-dark-42.png +0 -0
- drowse/web/dist/icons/tab-training-dark-43.png +0 -0
- drowse/web/dist/icons/tab-training-dark-44.png +0 -0
- drowse/web/dist/icons/tab-training-dark-45.png +0 -0
- drowse/web/dist/icons/tab-training-dark-46.png +0 -0
- drowse/web/dist/icons/tab-training-dark-47.png +0 -0
- drowse/web/dist/icons/tab-training-dark-5.png +0 -0
- drowse/web/dist/icons/tab-training-dark-6.png +0 -0
- drowse/web/dist/icons/tab-training-dark-7.png +0 -0
- drowse/web/dist/icons/tab-training-dark-8.png +0 -0
- drowse/web/dist/icons/tab-training-dark-9.png +0 -0
- drowse/web/dist/icons/tab-training-light-0.png +0 -0
- drowse/web/dist/icons/tab-training-light-1.png +0 -0
- drowse/web/dist/icons/tab-training-light-10.png +0 -0
- drowse/web/dist/icons/tab-training-light-11.png +0 -0
- drowse/web/dist/icons/tab-training-light-12.png +0 -0
- drowse/web/dist/icons/tab-training-light-13.png +0 -0
- drowse/web/dist/icons/tab-training-light-14.png +0 -0
- drowse/web/dist/icons/tab-training-light-15.png +0 -0
- drowse/web/dist/icons/tab-training-light-16.png +0 -0
- drowse/web/dist/icons/tab-training-light-17.png +0 -0
- drowse/web/dist/icons/tab-training-light-18.png +0 -0
- drowse/web/dist/icons/tab-training-light-19.png +0 -0
- drowse/web/dist/icons/tab-training-light-2.png +0 -0
- drowse/web/dist/icons/tab-training-light-20.png +0 -0
- drowse/web/dist/icons/tab-training-light-21.png +0 -0
- drowse/web/dist/icons/tab-training-light-22.png +0 -0
- drowse/web/dist/icons/tab-training-light-23.png +0 -0
- drowse/web/dist/icons/tab-training-light-24.png +0 -0
- drowse/web/dist/icons/tab-training-light-25.png +0 -0
- drowse/web/dist/icons/tab-training-light-26.png +0 -0
- drowse/web/dist/icons/tab-training-light-27.png +0 -0
- drowse/web/dist/icons/tab-training-light-28.png +0 -0
- drowse/web/dist/icons/tab-training-light-29.png +0 -0
- drowse/web/dist/icons/tab-training-light-3.png +0 -0
- drowse/web/dist/icons/tab-training-light-30.png +0 -0
- drowse/web/dist/icons/tab-training-light-31.png +0 -0
- drowse/web/dist/icons/tab-training-light-32.png +0 -0
- drowse/web/dist/icons/tab-training-light-33.png +0 -0
- drowse/web/dist/icons/tab-training-light-34.png +0 -0
- drowse/web/dist/icons/tab-training-light-35.png +0 -0
- drowse/web/dist/icons/tab-training-light-36.png +0 -0
- drowse/web/dist/icons/tab-training-light-37.png +0 -0
- drowse/web/dist/icons/tab-training-light-38.png +0 -0
- drowse/web/dist/icons/tab-training-light-39.png +0 -0
- drowse/web/dist/icons/tab-training-light-4.png +0 -0
- drowse/web/dist/icons/tab-training-light-40.png +0 -0
- drowse/web/dist/icons/tab-training-light-41.png +0 -0
- drowse/web/dist/icons/tab-training-light-42.png +0 -0
- drowse/web/dist/icons/tab-training-light-43.png +0 -0
- drowse/web/dist/icons/tab-training-light-44.png +0 -0
- drowse/web/dist/icons/tab-training-light-45.png +0 -0
- drowse/web/dist/icons/tab-training-light-46.png +0 -0
- drowse/web/dist/icons/tab-training-light-47.png +0 -0
- drowse/web/dist/icons/tab-training-light-5.png +0 -0
- drowse/web/dist/icons/tab-training-light-6.png +0 -0
- drowse/web/dist/icons/tab-training-light-7.png +0 -0
- drowse/web/dist/icons/tab-training-light-8.png +0 -0
- drowse/web/dist/icons/tab-training-light-9.png +0 -0
- drowse/web/dist/icons/tab-unsupported-dark.png +0 -0
- drowse/web/dist/icons/tab-unsupported-light.png +0 -0
- drowse/web/dist/icons/tab-unsupported.png +0 -0
- drowse/web/dist/icons/tab-working-0.png +0 -0
- drowse/web/dist/icons/tab-working-1.png +0 -0
- drowse/web/dist/icons/tab-working-2.png +0 -0
- drowse/web/dist/icons/tab-working-dark-0.png +0 -0
- drowse/web/dist/icons/tab-working-dark-1.png +0 -0
- drowse/web/dist/icons/tab-working-dark-10.png +0 -0
- drowse/web/dist/icons/tab-working-dark-11.png +0 -0
- drowse/web/dist/icons/tab-working-dark-12.png +0 -0
- drowse/web/dist/icons/tab-working-dark-13.png +0 -0
- drowse/web/dist/icons/tab-working-dark-14.png +0 -0
- drowse/web/dist/icons/tab-working-dark-15.png +0 -0
- drowse/web/dist/icons/tab-working-dark-16.png +0 -0
- drowse/web/dist/icons/tab-working-dark-17.png +0 -0
- drowse/web/dist/icons/tab-working-dark-18.png +0 -0
- drowse/web/dist/icons/tab-working-dark-19.png +0 -0
- drowse/web/dist/icons/tab-working-dark-2.png +0 -0
- drowse/web/dist/icons/tab-working-dark-20.png +0 -0
- drowse/web/dist/icons/tab-working-dark-21.png +0 -0
- drowse/web/dist/icons/tab-working-dark-22.png +0 -0
- drowse/web/dist/icons/tab-working-dark-23.png +0 -0
- drowse/web/dist/icons/tab-working-dark-24.png +0 -0
- drowse/web/dist/icons/tab-working-dark-25.png +0 -0
- drowse/web/dist/icons/tab-working-dark-26.png +0 -0
- drowse/web/dist/icons/tab-working-dark-27.png +0 -0
- drowse/web/dist/icons/tab-working-dark-28.png +0 -0
- drowse/web/dist/icons/tab-working-dark-29.png +0 -0
- drowse/web/dist/icons/tab-working-dark-3.png +0 -0
- drowse/web/dist/icons/tab-working-dark-30.png +0 -0
- drowse/web/dist/icons/tab-working-dark-31.png +0 -0
- drowse/web/dist/icons/tab-working-dark-32.png +0 -0
- drowse/web/dist/icons/tab-working-dark-33.png +0 -0
- drowse/web/dist/icons/tab-working-dark-34.png +0 -0
- drowse/web/dist/icons/tab-working-dark-35.png +0 -0
- drowse/web/dist/icons/tab-working-dark-36.png +0 -0
- drowse/web/dist/icons/tab-working-dark-37.png +0 -0
- drowse/web/dist/icons/tab-working-dark-38.png +0 -0
- drowse/web/dist/icons/tab-working-dark-39.png +0 -0
- drowse/web/dist/icons/tab-working-dark-4.png +0 -0
- drowse/web/dist/icons/tab-working-dark-40.png +0 -0
- drowse/web/dist/icons/tab-working-dark-41.png +0 -0
- drowse/web/dist/icons/tab-working-dark-42.png +0 -0
- drowse/web/dist/icons/tab-working-dark-43.png +0 -0
- drowse/web/dist/icons/tab-working-dark-44.png +0 -0
- drowse/web/dist/icons/tab-working-dark-45.png +0 -0
- drowse/web/dist/icons/tab-working-dark-46.png +0 -0
- drowse/web/dist/icons/tab-working-dark-47.png +0 -0
- drowse/web/dist/icons/tab-working-dark-5.png +0 -0
- drowse/web/dist/icons/tab-working-dark-6.png +0 -0
- drowse/web/dist/icons/tab-working-dark-7.png +0 -0
- drowse/web/dist/icons/tab-working-dark-8.png +0 -0
- drowse/web/dist/icons/tab-working-dark-9.png +0 -0
- drowse/web/dist/icons/tab-working-light-0.png +0 -0
- drowse/web/dist/icons/tab-working-light-1.png +0 -0
- drowse/web/dist/icons/tab-working-light-10.png +0 -0
- drowse/web/dist/icons/tab-working-light-11.png +0 -0
- drowse/web/dist/icons/tab-working-light-12.png +0 -0
- drowse/web/dist/icons/tab-working-light-13.png +0 -0
- drowse/web/dist/icons/tab-working-light-14.png +0 -0
- drowse/web/dist/icons/tab-working-light-15.png +0 -0
- drowse/web/dist/icons/tab-working-light-16.png +0 -0
- drowse/web/dist/icons/tab-working-light-17.png +0 -0
- drowse/web/dist/icons/tab-working-light-18.png +0 -0
- drowse/web/dist/icons/tab-working-light-19.png +0 -0
- drowse/web/dist/icons/tab-working-light-2.png +0 -0
- drowse/web/dist/icons/tab-working-light-20.png +0 -0
- drowse/web/dist/icons/tab-working-light-21.png +0 -0
- drowse/web/dist/icons/tab-working-light-22.png +0 -0
- drowse/web/dist/icons/tab-working-light-23.png +0 -0
- drowse/web/dist/icons/tab-working-light-24.png +0 -0
- drowse/web/dist/icons/tab-working-light-25.png +0 -0
- drowse/web/dist/icons/tab-working-light-26.png +0 -0
- drowse/web/dist/icons/tab-working-light-27.png +0 -0
- drowse/web/dist/icons/tab-working-light-28.png +0 -0
- drowse/web/dist/icons/tab-working-light-29.png +0 -0
- drowse/web/dist/icons/tab-working-light-3.png +0 -0
- drowse/web/dist/icons/tab-working-light-30.png +0 -0
- drowse/web/dist/icons/tab-working-light-31.png +0 -0
- drowse/web/dist/icons/tab-working-light-32.png +0 -0
- drowse/web/dist/icons/tab-working-light-33.png +0 -0
- drowse/web/dist/icons/tab-working-light-34.png +0 -0
- drowse/web/dist/icons/tab-working-light-35.png +0 -0
- drowse/web/dist/icons/tab-working-light-36.png +0 -0
- drowse/web/dist/icons/tab-working-light-37.png +0 -0
- drowse/web/dist/icons/tab-working-light-38.png +0 -0
- drowse/web/dist/icons/tab-working-light-39.png +0 -0
- drowse/web/dist/icons/tab-working-light-4.png +0 -0
- drowse/web/dist/icons/tab-working-light-40.png +0 -0
- drowse/web/dist/icons/tab-working-light-41.png +0 -0
- drowse/web/dist/icons/tab-working-light-42.png +0 -0
- drowse/web/dist/icons/tab-working-light-43.png +0 -0
- drowse/web/dist/icons/tab-working-light-44.png +0 -0
- drowse/web/dist/icons/tab-working-light-45.png +0 -0
- drowse/web/dist/icons/tab-working-light-46.png +0 -0
- drowse/web/dist/icons/tab-working-light-47.png +0 -0
- drowse/web/dist/icons/tab-working-light-5.png +0 -0
- drowse/web/dist/icons/tab-working-light-6.png +0 -0
- drowse/web/dist/icons/tab-working-light-7.png +0 -0
- drowse/web/dist/icons/tab-working-light-8.png +0 -0
- drowse/web/dist/icons/tab-working-light-9.png +0 -0
- drowse/web/dist/index.html +34 -0
- drowse/web/dist/social/drowse.png +0 -0
- drowse/web/dist/social/drowse.svg +6 -0
- drowse/web/dist/theme-init.js +25 -0
- drowse/web/routes.py +118 -0
- drowse_ai-5.3.1.dist-info/METADATA +632 -0
- drowse_ai-5.3.1.dist-info/RECORD +1341 -0
- drowse_ai-5.3.1.dist-info/WHEEL +5 -0
- drowse_ai-5.3.1.dist-info/entry_points.txt +2 -0
- drowse_ai-5.3.1.dist-info/licenses/LICENSE +661 -0
- drowse_ai-5.3.1.dist-info/top_level.txt +1 -0
drowse/io/alignment.py
ADDED
|
@@ -0,0 +1,1334 @@
|
|
|
1
|
+
"""Cross-model probe alignment via per-layer Procrustes (v1.6).
|
|
2
|
+
|
|
3
|
+
Probes are extracted per (model, concept). A probe extracted on one
|
|
4
|
+
model isn't directly usable on a different model — different tokenizers,
|
|
5
|
+
different hidden dims, different basis rotation in the residual stream.
|
|
6
|
+
This module fits a per-layer linear map between two models' neutral
|
|
7
|
+
activations (``Procrustes`` for matched dim, low-rank PCA-and-lift for
|
|
8
|
+
mismatched dim); ``core.manifold.transfer_manifold_subspaces``, driven by
|
|
9
|
+
``io.manifold_lifecycle.transfer_manifold``, is what applies it.
|
|
10
|
+
|
|
11
|
+
Public surface:
|
|
12
|
+
|
|
13
|
+
* :func:`load_or_compute_neutral_activations` — disk-cached per-model
|
|
14
|
+
neutral-statement activations; ``[N, D]`` per layer, stored fp32.
|
|
15
|
+
Its metadata-returning sibling lets dependent artifact builders reuse the
|
|
16
|
+
sidecar validated in that same cache transaction instead of hashing the
|
|
17
|
+
payload again merely to recover its identity.
|
|
18
|
+
* :func:`fit_alignment` — per-layer alignment map ``M_L : ℝ^D_src → ℝ^D_tgt``.
|
|
19
|
+
* :func:`alignment_cache_path` — disk cache for the fitted map keyed by
|
|
20
|
+
the source model id.
|
|
21
|
+
|
|
22
|
+
The transferred manifold lands at the target model's tensor path with a
|
|
23
|
+
``_from-<safe_src>`` suffix — uses the same variant-suffix machinery as
|
|
24
|
+
SAE variants, so the rest of drowse (selectors, packs, monitor) sees a
|
|
25
|
+
transferred probe as just another tensor on disk.
|
|
26
|
+
"""
|
|
27
|
+
from __future__ import annotations
|
|
28
|
+
|
|
29
|
+
import hashlib
|
|
30
|
+
import json
|
|
31
|
+
import math
|
|
32
|
+
import logging
|
|
33
|
+
import sys
|
|
34
|
+
from contextlib import contextmanager
|
|
35
|
+
from dataclasses import dataclass
|
|
36
|
+
from pathlib import Path
|
|
37
|
+
from typing import Any, Callable, Iterable, Iterator, Mapping, Sequence
|
|
38
|
+
|
|
39
|
+
import torch
|
|
40
|
+
from safetensors import safe_open
|
|
41
|
+
from safetensors.torch import (
|
|
42
|
+
load as load_safetensors,
|
|
43
|
+
save as save_safetensors,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
from drowse.core.errors import DrowseError
|
|
47
|
+
from drowse.io.atomic import fsync_directory, write_bytes_atomic, write_json_atomic
|
|
48
|
+
from drowse.io.paths import model_dir, safe_model_id
|
|
49
|
+
from drowse.io.integrity import hash_file
|
|
50
|
+
from drowse.io.shards import (
|
|
51
|
+
cleanup_generations,
|
|
52
|
+
fit_lock,
|
|
53
|
+
generation_path,
|
|
54
|
+
json_pointer_matches as _json_pointer_matches,
|
|
55
|
+
shard_paths,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
log = logging.getLogger(__name__)
|
|
59
|
+
|
|
60
|
+
# Artifact labels for the shared shard primitive's error/log wording.
|
|
61
|
+
_NEUTRAL_LABEL = "neutral activation cache"
|
|
62
|
+
_ALIGNMENT_LABEL = "alignment cache"
|
|
63
|
+
|
|
64
|
+
_NEUTRAL_ACTS_NAME = "neutral_activations"
|
|
65
|
+
_NEUTRAL_CACHE_FORMAT_VERSION = 4
|
|
66
|
+
_NEUTRAL_CAPTURE_VERSION = 1
|
|
67
|
+
_ALIGNMENT_CACHE_FORMAT_VERSION = 5
|
|
68
|
+
|
|
69
|
+
_NEUTRAL_SIDECAR_FIELDS = {
|
|
70
|
+
"method", "format_version", "capture_version", "capture_sha256",
|
|
71
|
+
"model_fingerprint", "model_source_fingerprint", "tensor_sha256",
|
|
72
|
+
"tensor_files", "layers", "tensor_schema", "n_prompts", "n_layers",
|
|
73
|
+
}
|
|
74
|
+
_ALIGNMENT_SIDECAR_FIELDS = {
|
|
75
|
+
"format_version", "method", "source_model_id", "target_model_id",
|
|
76
|
+
"shared_layers", "tensor_schema", "source_neutral_identity",
|
|
77
|
+
"target_neutral_identity", "tensor_files", "tensor_sha256",
|
|
78
|
+
"quality_per_layer",
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
@dataclass(frozen=True)
|
|
83
|
+
class LayerAlignment:
|
|
84
|
+
"""Compact affine source->target activation map for one layer.
|
|
85
|
+
|
|
86
|
+
``linear(x) = left @ (right @ x)`` stores a rank-``r`` map in
|
|
87
|
+
``O(r * (D_src + D_tgt))`` rather than materializing ``D_tgt * D_src``.
|
|
88
|
+
``offset`` is applied only to activation *points*. Directions intentionally
|
|
89
|
+
use the linear component alone.
|
|
90
|
+
"""
|
|
91
|
+
|
|
92
|
+
left: torch.Tensor # (D_tgt, r)
|
|
93
|
+
right: torch.Tensor # (r, D_src)
|
|
94
|
+
offset: torch.Tensor # (D_tgt,)
|
|
95
|
+
|
|
96
|
+
def __post_init__(self) -> None:
|
|
97
|
+
if self.left.ndim != 2 or self.right.ndim != 2 or self.offset.ndim != 1:
|
|
98
|
+
raise ValueError("alignment factors must be 2-D, 2-D, and 1-D")
|
|
99
|
+
if self.left.shape[1] != self.right.shape[0]:
|
|
100
|
+
raise ValueError("alignment factor ranks do not match")
|
|
101
|
+
if self.left.shape[0] != self.offset.shape[0]:
|
|
102
|
+
raise ValueError("alignment offset does not match target dimension")
|
|
103
|
+
if self.left.shape[1] == 0:
|
|
104
|
+
raise ValueError("alignment rank must be positive")
|
|
105
|
+
device = self.left.device
|
|
106
|
+
object.__setattr__(
|
|
107
|
+
self, "left", self.left.to(device=device, dtype=torch.float32).contiguous(),
|
|
108
|
+
)
|
|
109
|
+
object.__setattr__(
|
|
110
|
+
self, "right", self.right.to(device=device, dtype=torch.float32).contiguous(),
|
|
111
|
+
)
|
|
112
|
+
object.__setattr__(
|
|
113
|
+
self, "offset", self.offset.to(device=device, dtype=torch.float32).contiguous(),
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
@property
|
|
117
|
+
def source_dim(self) -> int:
|
|
118
|
+
return int(self.right.shape[1])
|
|
119
|
+
|
|
120
|
+
@property
|
|
121
|
+
def target_dim(self) -> int:
|
|
122
|
+
return int(self.left.shape[0])
|
|
123
|
+
|
|
124
|
+
@property
|
|
125
|
+
def rank(self) -> int:
|
|
126
|
+
return int(self.left.shape[1])
|
|
127
|
+
|
|
128
|
+
@property
|
|
129
|
+
def shape(self) -> tuple[int, int]:
|
|
130
|
+
return (self.target_dim, self.source_dim)
|
|
131
|
+
|
|
132
|
+
@property
|
|
133
|
+
def device(self) -> torch.device:
|
|
134
|
+
return self.left.device
|
|
135
|
+
|
|
136
|
+
def apply_vector(self, value: torch.Tensor) -> torch.Tensor:
|
|
137
|
+
value = value.to(device=self.device, dtype=torch.float32)
|
|
138
|
+
return self.left @ (self.right @ value)
|
|
139
|
+
|
|
140
|
+
def apply_vectors(self, value: torch.Tensor) -> torch.Tensor:
|
|
141
|
+
"""Apply the linear component to row-major ``(..., D_src)`` vectors."""
|
|
142
|
+
value = value.to(device=self.device, dtype=torch.float32)
|
|
143
|
+
return (value @ self.right.transpose(0, 1)) @ self.left.transpose(0, 1)
|
|
144
|
+
|
|
145
|
+
def apply_points(self, value: torch.Tensor) -> torch.Tensor:
|
|
146
|
+
value = value.to(device=self.device, dtype=torch.float32)
|
|
147
|
+
return self.apply_vectors(value) + self.offset
|
|
148
|
+
|
|
149
|
+
def to_dense(self) -> torch.Tensor:
|
|
150
|
+
return self.left @ self.right
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
AlignmentMap = Mapping[int, LayerAlignment]
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
# ---------------------------------------------------------------------------
|
|
157
|
+
# Per-model neutral activation cache.
|
|
158
|
+
# ---------------------------------------------------------------------------
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
def _neutral_acts_paths(model_id: str) -> tuple[Path, Path]:
|
|
162
|
+
"""Return the stable lock anchor and atomic pointer sidecar."""
|
|
163
|
+
md = model_dir(model_id)
|
|
164
|
+
return (
|
|
165
|
+
md / f"{_NEUTRAL_ACTS_NAME}.safetensors",
|
|
166
|
+
md / f"{_NEUTRAL_ACTS_NAME}.json",
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def _neutral_shard_paths(
|
|
171
|
+
anchor: Path, sidecar: Mapping[str, Any], layers: list[int],
|
|
172
|
+
) -> dict[int, Path]:
|
|
173
|
+
return shard_paths(anchor, sidecar, layers, label=_NEUTRAL_LABEL)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def _cleanup_neutral_generations(
|
|
177
|
+
anchor: Path, sidecar: Mapping[str, Any],
|
|
178
|
+
) -> None:
|
|
179
|
+
cleanup_generations(anchor, sidecar, label=_NEUTRAL_LABEL)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
@contextmanager
|
|
183
|
+
def neutral_fit_lock(model_id: str) -> Iterator[None]:
|
|
184
|
+
"""Single-flight lock for one model's expensive neutral forward pass."""
|
|
185
|
+
ts_path, _ = _neutral_acts_paths(model_id)
|
|
186
|
+
with fit_lock(ts_path):
|
|
187
|
+
yield
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def validate_neutral_cache_metadata(
|
|
191
|
+
model_id: str, *, verify_payload: bool = True,
|
|
192
|
+
) -> dict[str, Any]:
|
|
193
|
+
"""Validate a neutral cache's identity and tensor header without paging data.
|
|
194
|
+
|
|
195
|
+
The payload digest proves bytes, while ``safe_open`` checks the declared
|
|
196
|
+
key/shape/dtype schema from the mmap header. This is the cheap preflight for
|
|
197
|
+
exact transfer repeats; numerical finite checks remain in the materializing
|
|
198
|
+
loader used by fits and whiteners.
|
|
199
|
+
"""
|
|
200
|
+
from drowse.io.atomic import artifact_lock
|
|
201
|
+
|
|
202
|
+
ts_path, _ = _neutral_acts_paths(model_id)
|
|
203
|
+
with artifact_lock(ts_path):
|
|
204
|
+
return _validate_neutral_cache_metadata_locked(
|
|
205
|
+
model_id, verify_payload=verify_payload,
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def _validate_neutral_cache_metadata_locked(
|
|
210
|
+
model_id: str, *, verify_payload: bool = True,
|
|
211
|
+
) -> dict[str, Any]:
|
|
212
|
+
"""Header/digest validation with the neutral pair lock already held."""
|
|
213
|
+
ts_path, sc_path = _neutral_acts_paths(model_id)
|
|
214
|
+
if not sc_path.exists():
|
|
215
|
+
raise FileNotFoundError(f"neutral activation cache missing for {model_id}")
|
|
216
|
+
with open(sc_path) as handle:
|
|
217
|
+
sidecar = json.load(handle)
|
|
218
|
+
if not isinstance(sidecar, dict) or set(sidecar) != _NEUTRAL_SIDECAR_FIELDS:
|
|
219
|
+
raise ValueError("neutral activation cache sidecar has a non-current schema")
|
|
220
|
+
version = sidecar["format_version"]
|
|
221
|
+
if (
|
|
222
|
+
not isinstance(version, int)
|
|
223
|
+
or isinstance(version, bool)
|
|
224
|
+
or version != _NEUTRAL_CACHE_FORMAT_VERSION
|
|
225
|
+
or isinstance(sidecar["capture_version"], bool)
|
|
226
|
+
or not isinstance(sidecar["capture_version"], int)
|
|
227
|
+
or sidecar["capture_version"] != _NEUTRAL_CAPTURE_VERSION
|
|
228
|
+
or sidecar["method"] != "neutral_activations"
|
|
229
|
+
or any(
|
|
230
|
+
not isinstance(sidecar[key], str) or not sidecar[key]
|
|
231
|
+
for key in (
|
|
232
|
+
"capture_sha256", "model_fingerprint",
|
|
233
|
+
"model_source_fingerprint",
|
|
234
|
+
)
|
|
235
|
+
)
|
|
236
|
+
):
|
|
237
|
+
raise ValueError("neutral activation cache identity mismatch")
|
|
238
|
+
layers = sidecar["layers"]
|
|
239
|
+
schema = sidecar["tensor_schema"]
|
|
240
|
+
if (
|
|
241
|
+
not isinstance(layers, list)
|
|
242
|
+
or not layers
|
|
243
|
+
or any(
|
|
244
|
+
isinstance(layer, bool) or not isinstance(layer, int) or layer < 0
|
|
245
|
+
for layer in layers
|
|
246
|
+
)
|
|
247
|
+
or layers != sorted(set(layers))
|
|
248
|
+
or not isinstance(schema, dict)
|
|
249
|
+
or set(schema) != {str(layer) for layer in layers}
|
|
250
|
+
or isinstance(sidecar["n_prompts"], bool)
|
|
251
|
+
or not isinstance(sidecar["n_prompts"], int)
|
|
252
|
+
or sidecar["n_prompts"] <= 0
|
|
253
|
+
or isinstance(sidecar["n_layers"], bool)
|
|
254
|
+
or not isinstance(sidecar["n_layers"], int)
|
|
255
|
+
or sidecar["n_layers"] != len(layers)
|
|
256
|
+
):
|
|
257
|
+
raise ValueError("neutral activation cache sidecar has no layer schema")
|
|
258
|
+
normalized_layers = layers
|
|
259
|
+
expected_n = sidecar["n_prompts"]
|
|
260
|
+
paths = _neutral_shard_paths(ts_path, sidecar, normalized_layers)
|
|
261
|
+
digests = sidecar.get("tensor_sha256")
|
|
262
|
+
if (
|
|
263
|
+
not isinstance(digests, Mapping)
|
|
264
|
+
or set(digests) != {str(layer) for layer in layers}
|
|
265
|
+
):
|
|
266
|
+
raise ValueError("neutral activation cache has no tensor digests")
|
|
267
|
+
grouped = {path: [layer] for layer, path in paths.items()}
|
|
268
|
+
for layer, path in paths.items():
|
|
269
|
+
digest = digests.get(str(layer))
|
|
270
|
+
if (
|
|
271
|
+
not isinstance(digest, str)
|
|
272
|
+
or len(digest) != 64
|
|
273
|
+
or any(char not in "0123456789abcdef" for char in digest)
|
|
274
|
+
or not path.exists()
|
|
275
|
+
):
|
|
276
|
+
raise ValueError(f"invalid neutral shard for layer {layer}")
|
|
277
|
+
if verify_payload and hash_file(path) != digest:
|
|
278
|
+
raise ValueError("neutral activation cache payload digest mismatch")
|
|
279
|
+
for path, path_layers in grouped.items():
|
|
280
|
+
with safe_open(str(path), framework="pt", device="cpu") as tensors:
|
|
281
|
+
path_keys = {f"layer_{layer}" for layer in path_layers}
|
|
282
|
+
if set(tensors.keys()) != path_keys:
|
|
283
|
+
raise ValueError("neutral activation cache layer keys do not match sidecar")
|
|
284
|
+
for key in tensors.keys():
|
|
285
|
+
layer = int(key.split("_", 1)[1])
|
|
286
|
+
spec = schema.get(str(layer), {})
|
|
287
|
+
view = tensors.get_slice(key)
|
|
288
|
+
shape = list(view.get_shape())
|
|
289
|
+
if (
|
|
290
|
+
not isinstance(spec, dict)
|
|
291
|
+
or set(spec) != {"shape", "dtype"}
|
|
292
|
+
or not isinstance(spec["shape"], list)
|
|
293
|
+
or any(
|
|
294
|
+
isinstance(dim, bool) or not isinstance(dim, int) or dim <= 0
|
|
295
|
+
for dim in spec["shape"]
|
|
296
|
+
)
|
|
297
|
+
or view.get_dtype() != "F32"
|
|
298
|
+
or spec.get("dtype") != "torch.float32"
|
|
299
|
+
or shape != spec.get("shape")
|
|
300
|
+
or len(shape) != 2
|
|
301
|
+
or shape[0] != expected_n
|
|
302
|
+
):
|
|
303
|
+
raise ValueError(
|
|
304
|
+
f"neutral activation cache layer {layer} header failed validation"
|
|
305
|
+
)
|
|
306
|
+
return sidecar
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
def load_validated_neutral_cache(
|
|
310
|
+
model_id: str,
|
|
311
|
+
*,
|
|
312
|
+
requested_layers: Iterable[int] | None = None,
|
|
313
|
+
) -> tuple[dict[int, torch.Tensor], dict[str, Any]]:
|
|
314
|
+
"""Materialize and fully validate a neutral cache without loading the model."""
|
|
315
|
+
from drowse.io.atomic import artifact_lock
|
|
316
|
+
|
|
317
|
+
ts_path, _ = _neutral_acts_paths(model_id)
|
|
318
|
+
with artifact_lock(ts_path):
|
|
319
|
+
sidecar = _validate_neutral_cache_metadata_locked(
|
|
320
|
+
model_id, verify_payload=False,
|
|
321
|
+
)
|
|
322
|
+
all_layers = sorted(int(layer) for layer in sidecar["layers"])
|
|
323
|
+
selected = (
|
|
324
|
+
all_layers if requested_layers is None else sorted(
|
|
325
|
+
set(all_layers) & {int(layer) for layer in requested_layers}
|
|
326
|
+
)
|
|
327
|
+
)
|
|
328
|
+
paths = _neutral_shard_paths(ts_path, sidecar, all_layers)
|
|
329
|
+
digests = sidecar["tensor_sha256"]
|
|
330
|
+
tensors: dict[str, torch.Tensor] = {}
|
|
331
|
+
for layer in selected:
|
|
332
|
+
payload = paths[layer].read_bytes()
|
|
333
|
+
if hashlib.sha256(payload).hexdigest() != digests[str(layer)]:
|
|
334
|
+
raise ValueError("neutral activation cache payload digest mismatch")
|
|
335
|
+
shard = load_safetensors(payload)
|
|
336
|
+
tensors[f"layer_{layer}"] = shard[f"layer_{layer}"]
|
|
337
|
+
# Reap superseded generations preserved by a signal immediately after
|
|
338
|
+
# pointer replacement while the pair lock keeps references stable.
|
|
339
|
+
_cleanup_neutral_generations(ts_path, sidecar)
|
|
340
|
+
fsync_directory(ts_path.parent)
|
|
341
|
+
out: dict[int, torch.Tensor] = {}
|
|
342
|
+
schema = sidecar["tensor_schema"]
|
|
343
|
+
expected_n = int(sidecar.get("n_prompts", -1))
|
|
344
|
+
for key, tensor in tensors.items():
|
|
345
|
+
layer = int(key.split("_", 1)[1])
|
|
346
|
+
expected_shape = schema.get(str(layer), {}).get("shape")
|
|
347
|
+
if (
|
|
348
|
+
tensor.dtype != torch.float32
|
|
349
|
+
or list(tensor.shape) != expected_shape
|
|
350
|
+
or tensor.ndim != 2
|
|
351
|
+
or int(tensor.shape[0]) != expected_n
|
|
352
|
+
or not bool(torch.isfinite(tensor).all())
|
|
353
|
+
):
|
|
354
|
+
raise ValueError(f"neutral activation cache layer {layer} failed validation")
|
|
355
|
+
out[layer] = tensor
|
|
356
|
+
return out, sidecar
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
def neutral_cache_identity(sidecar: dict[str, Any]) -> dict[str, Any]:
|
|
360
|
+
"""Stable identity subset embedded into dependent alignment artifacts."""
|
|
361
|
+
keys = (
|
|
362
|
+
"format_version", "capture_version", "model_fingerprint",
|
|
363
|
+
"model_source_fingerprint",
|
|
364
|
+
"capture_sha256", "tensor_sha256", "layers", "tensor_schema",
|
|
365
|
+
"n_prompts",
|
|
366
|
+
)
|
|
367
|
+
required = {*keys, "tensor_files", "method"}
|
|
368
|
+
if (
|
|
369
|
+
not required <= set(sidecar)
|
|
370
|
+
or sidecar["format_version"] != _NEUTRAL_CACHE_FORMAT_VERSION
|
|
371
|
+
or sidecar["method"] != "neutral_activations"
|
|
372
|
+
):
|
|
373
|
+
raise ValueError("neutral cache identity requires current validated metadata")
|
|
374
|
+
identity = {key: sidecar[key] for key in keys}
|
|
375
|
+
identity["tensor_files"] = sidecar["tensor_files"]
|
|
376
|
+
return identity
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
def load_or_compute_neutral_activations(
|
|
380
|
+
model: Any,
|
|
381
|
+
tokenizer: Any,
|
|
382
|
+
layers: Any,
|
|
383
|
+
*,
|
|
384
|
+
model_id: str,
|
|
385
|
+
force: bool = False,
|
|
386
|
+
on_progress: Callable[[str], None] | None = None,
|
|
387
|
+
) -> dict[int, torch.Tensor]:
|
|
388
|
+
"""Single-flight neutral-cache load/capture, returning activations only.
|
|
389
|
+
|
|
390
|
+
``on_progress`` narrates the cache-miss capture loop (per forward chunk);
|
|
391
|
+
a cache hit reports nothing because it runs no model.
|
|
392
|
+
"""
|
|
393
|
+
activations, _sidecar = load_or_compute_neutral_activations_with_metadata(
|
|
394
|
+
model, tokenizer, layers, model_id=model_id, force=force,
|
|
395
|
+
on_progress=on_progress,
|
|
396
|
+
)
|
|
397
|
+
return activations
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
def load_or_compute_neutral_activations_with_metadata(
|
|
401
|
+
model: Any,
|
|
402
|
+
tokenizer: Any,
|
|
403
|
+
layers: Any,
|
|
404
|
+
*,
|
|
405
|
+
model_id: str,
|
|
406
|
+
force: bool = False,
|
|
407
|
+
on_progress: Callable[[str], None] | None = None,
|
|
408
|
+
) -> tuple[dict[int, torch.Tensor], dict[str, Any]]:
|
|
409
|
+
"""Return activations plus the sidecar proven in the same transaction.
|
|
410
|
+
|
|
411
|
+
Alignment fitting needs both the materialized neutral rows and their stable
|
|
412
|
+
cache identity. Returning the already-validated sidecar avoids an immediate
|
|
413
|
+
second full-file digest pass through
|
|
414
|
+
:func:`validate_neutral_cache_metadata`. The activation-only public API
|
|
415
|
+
above remains the convenience surface for ordinary whitener/probe callers.
|
|
416
|
+
"""
|
|
417
|
+
with neutral_fit_lock(model_id):
|
|
418
|
+
return _load_or_compute_neutral_activations_with_metadata_locked(
|
|
419
|
+
model, tokenizer, layers, model_id=model_id, force=force,
|
|
420
|
+
on_progress=on_progress,
|
|
421
|
+
)
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
def _load_or_compute_neutral_activations_with_metadata_locked(
|
|
425
|
+
model: Any,
|
|
426
|
+
tokenizer: Any,
|
|
427
|
+
layers: Any,
|
|
428
|
+
*,
|
|
429
|
+
model_id: str,
|
|
430
|
+
force: bool = False,
|
|
431
|
+
on_progress: Callable[[str], None] | None = None,
|
|
432
|
+
) -> tuple[dict[int, torch.Tensor], dict[str, Any]]:
|
|
433
|
+
"""Disk-cached per-statement activations for one model.
|
|
434
|
+
|
|
435
|
+
Cache identity binds the exact rendered token rows and pooling positions,
|
|
436
|
+
the loaded model weights, and the fitted layer set. The tensor payload is
|
|
437
|
+
digest-verified before reuse. A stale cache is recomputed and replaced.
|
|
438
|
+
|
|
439
|
+
Returns ``({layer_idx: [N, D] fp32 CPU tensor}, validated_sidecar)``.
|
|
440
|
+
Stored fp32 on disk so the whitener covariance is built and inverted at
|
|
441
|
+
full precision and the compute path (cache miss) and cache-hit path return
|
|
442
|
+
bit-identical tensors (no precision seam — bf16's ~0.4% input error landed
|
|
443
|
+
on exactly the inverted quantity). fp16 was abandoned because its 65504
|
|
444
|
+
ceiling overflows gemma-3's extreme late-layer channels to ±inf (poisoning
|
|
445
|
+
``λ`` / ``K``); fp32 has the range and, unlike the former bf16 store, no
|
|
446
|
+
input-precision loss, at the cost of ~2× disk on this one cache.
|
|
447
|
+
"""
|
|
448
|
+
from drowse.core.model import loaded_model_fingerprint
|
|
449
|
+
from drowse.core.capture import (
|
|
450
|
+
_neutral_pairs,
|
|
451
|
+
_prepare_capture_batch,
|
|
452
|
+
compute_neutral_activations,
|
|
453
|
+
)
|
|
454
|
+
|
|
455
|
+
ts_path, sc_path = _neutral_acts_paths(model_id)
|
|
456
|
+
md = model_dir(model_id)
|
|
457
|
+
md.mkdir(parents=True, exist_ok=True)
|
|
458
|
+
|
|
459
|
+
pairs = _neutral_pairs()
|
|
460
|
+
prompts = [prompt for prompt, _ in pairs]
|
|
461
|
+
responses = [response for _, response in pairs]
|
|
462
|
+
prepared = _prepare_capture_batch(
|
|
463
|
+
tokenizer, prompts, responses,
|
|
464
|
+
)
|
|
465
|
+
rendered_payload = [
|
|
466
|
+
{"input_ids": ids[0].tolist(), "content_end": int(content_end)}
|
|
467
|
+
for ids, content_end in prepared
|
|
468
|
+
]
|
|
469
|
+
capture_sha = hashlib.sha256(json.dumps(
|
|
470
|
+
{"capture_version": _NEUTRAL_CAPTURE_VERSION, "rows": rendered_payload},
|
|
471
|
+
sort_keys=True, separators=(",", ":"),
|
|
472
|
+
).encode("utf-8")).hexdigest()
|
|
473
|
+
model_fingerprint = loaded_model_fingerprint(model, model_id)
|
|
474
|
+
base_model = getattr(model, "_orig_mod", model)
|
|
475
|
+
model_source_fingerprint = getattr(
|
|
476
|
+
base_model, "_drowse_source_fingerprint", None,
|
|
477
|
+
)
|
|
478
|
+
expected_layers = list(range(len(layers)))
|
|
479
|
+
|
|
480
|
+
if not force and sc_path.exists():
|
|
481
|
+
try:
|
|
482
|
+
out, sc = load_validated_neutral_cache(model_id)
|
|
483
|
+
identity_matches = (
|
|
484
|
+
sc.get("format_version") == _NEUTRAL_CACHE_FORMAT_VERSION
|
|
485
|
+
and sc.get("capture_version") == _NEUTRAL_CAPTURE_VERSION
|
|
486
|
+
and sc.get("capture_sha256") == capture_sha
|
|
487
|
+
and sc.get("model_fingerprint") == model_fingerprint
|
|
488
|
+
and sc.get("model_source_fingerprint") == model_source_fingerprint
|
|
489
|
+
and sc.get("layers") == expected_layers
|
|
490
|
+
)
|
|
491
|
+
if identity_matches:
|
|
492
|
+
log.debug("Loaded cached neutral activations for %s", model_id)
|
|
493
|
+
return out, sc
|
|
494
|
+
else:
|
|
495
|
+
log.info(
|
|
496
|
+
"Neutral activations stale (model/token/corpus/layer identity changed); "
|
|
497
|
+
"recomputing for %s",
|
|
498
|
+
model_id,
|
|
499
|
+
)
|
|
500
|
+
except Exception as e:
|
|
501
|
+
log.warning("Corrupt neutral activations cache for %s, recomputing: %s", model_id, e)
|
|
502
|
+
|
|
503
|
+
log.info("Computing neutral activations (one-time per model)...")
|
|
504
|
+
if on_progress is not None:
|
|
505
|
+
on_progress(
|
|
506
|
+
f"Computing neutral activations for {model_id} "
|
|
507
|
+
f"(one-time per model, {len(pairs)} prompts)..."
|
|
508
|
+
)
|
|
509
|
+
activations = compute_neutral_activations(
|
|
510
|
+
model, tokenizer, layers, rendered=prepared, on_progress=on_progress,
|
|
511
|
+
)
|
|
512
|
+
|
|
513
|
+
# Persist fp32 — the whitener covariance is built and inverted from these,
|
|
514
|
+
# so the compute path (this fresh fp32 store) and the cache-hit path stay
|
|
515
|
+
# bit-identical (no precision seam) and the inversion is full-precision.
|
|
516
|
+
# fp32 carries the exponent range fp16 lacked (gemma-3's late layers exceed
|
|
517
|
+
# the fp16 max of 65504 and overflowed to ±inf) without bf16's input loss,
|
|
518
|
+
# at ~2× disk on this one cache.
|
|
519
|
+
fp32 = {
|
|
520
|
+
int(idx): t.contiguous().to(torch.float32).cpu()
|
|
521
|
+
for idx, t in activations.items()
|
|
522
|
+
}
|
|
523
|
+
from drowse.io.atomic import artifact_lock
|
|
524
|
+
|
|
525
|
+
with artifact_lock(ts_path):
|
|
526
|
+
tensor_files: dict[str, str] = {}
|
|
527
|
+
tensor_sha256: dict[str, str] = {}
|
|
528
|
+
created: list[Path] = []
|
|
529
|
+
try:
|
|
530
|
+
for idx, tensor in sorted(fp32.items()):
|
|
531
|
+
path = generation_path(ts_path, idx)
|
|
532
|
+
payload = save_safetensors({f"layer_{idx}": tensor})
|
|
533
|
+
write_bytes_atomic(path, payload)
|
|
534
|
+
created.append(path)
|
|
535
|
+
tensor_files[str(idx)] = path.name
|
|
536
|
+
tensor_sha256[str(idx)] = hashlib.sha256(payload).hexdigest()
|
|
537
|
+
except BaseException:
|
|
538
|
+
for path in created:
|
|
539
|
+
path.unlink(missing_ok=True)
|
|
540
|
+
raise
|
|
541
|
+
sidecar: dict[str, Any] = {
|
|
542
|
+
"method": "neutral_activations",
|
|
543
|
+
"format_version": _NEUTRAL_CACHE_FORMAT_VERSION,
|
|
544
|
+
"capture_version": _NEUTRAL_CAPTURE_VERSION,
|
|
545
|
+
"capture_sha256": capture_sha,
|
|
546
|
+
"model_fingerprint": model_fingerprint,
|
|
547
|
+
"model_source_fingerprint": model_source_fingerprint,
|
|
548
|
+
"tensor_sha256": tensor_sha256,
|
|
549
|
+
"tensor_files": tensor_files,
|
|
550
|
+
"layers": sorted(activations),
|
|
551
|
+
"tensor_schema": {
|
|
552
|
+
str(idx): {"shape": list(t.shape), "dtype": str(t.dtype)}
|
|
553
|
+
for idx, t in sorted(activations.items())
|
|
554
|
+
},
|
|
555
|
+
"n_prompts": (
|
|
556
|
+
next(iter(activations.values())).shape[0] if activations else 0
|
|
557
|
+
),
|
|
558
|
+
"n_layers": len(activations),
|
|
559
|
+
}
|
|
560
|
+
if set(sidecar) != _NEUTRAL_SIDECAR_FIELDS:
|
|
561
|
+
raise AssertionError("neutral writer produced a non-canonical sidecar")
|
|
562
|
+
try:
|
|
563
|
+
# Persist every new directory entry before publishing the pointer.
|
|
564
|
+
# A crash can therefore expose either the complete old generation
|
|
565
|
+
# or the complete new one, never a pointer to absent shards.
|
|
566
|
+
fsync_directory(sc_path.parent)
|
|
567
|
+
write_json_atomic(sc_path, sidecar)
|
|
568
|
+
except BaseException:
|
|
569
|
+
if not _json_pointer_matches(sc_path, sidecar):
|
|
570
|
+
for path in created:
|
|
571
|
+
path.unlink(missing_ok=True)
|
|
572
|
+
raise
|
|
573
|
+
# The pointer rename is now authoritative. Preserve its generations if
|
|
574
|
+
# this durability barrier itself fails; deleting them would break the
|
|
575
|
+
# successfully replaced pointer immediately.
|
|
576
|
+
fsync_directory(sc_path.parent)
|
|
577
|
+
_cleanup_neutral_generations(ts_path, sidecar)
|
|
578
|
+
fsync_directory(sc_path.parent)
|
|
579
|
+
return activations, sidecar
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
# ---------------------------------------------------------------------------
|
|
583
|
+
# Alignment fit.
|
|
584
|
+
# ---------------------------------------------------------------------------
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
class AlignmentError(ValueError, DrowseError):
|
|
588
|
+
"""Raised when an alignment can't be fit (insufficient shared layers)."""
|
|
589
|
+
|
|
590
|
+
def user_message(self) -> tuple[int, str]:
|
|
591
|
+
return (422, str(self) or self.__class__.__name__)
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
def fit_alignment(
|
|
595
|
+
src_acts: dict[int, torch.Tensor],
|
|
596
|
+
tgt_acts: dict[int, torch.Tensor],
|
|
597
|
+
*,
|
|
598
|
+
min_shared_layers: int = 10,
|
|
599
|
+
requested_layers: Iterable[int] | None = None,
|
|
600
|
+
available_shared_layers: Iterable[int] | None = None,
|
|
601
|
+
) -> dict[int, LayerAlignment]:
|
|
602
|
+
"""Per-layer compact affine mapping ``A_L : ℝ^D_src → ℝ^D_tgt``.
|
|
603
|
+
|
|
604
|
+
For each layer the two models share, fits ``A_L(x) = M_L x + b_L`` such
|
|
605
|
+
that matched neutral activation *points* map source→target. Directions
|
|
606
|
+
use ``M_L`` alone, so translations never contaminate profile transfer.
|
|
607
|
+
|
|
608
|
+
* **Same hidden dim:** evidence-supported orthogonal Procrustes, factored
|
|
609
|
+
through economy QR row-space bases and a small ``<=N`` SVD. No arbitrary
|
|
610
|
+
unobserved ``D-N`` complement is invented.
|
|
611
|
+
* **Different hidden dim:** minimum-norm least squares from the thin SVD of
|
|
612
|
+
``X_src``. The result stays as rank-sized factors instead of a dense
|
|
613
|
+
``D_tgt × D_src`` matrix.
|
|
614
|
+
|
|
615
|
+
The translation is ``b_L = mean_tgt - M_L mean_src``. Returns compact
|
|
616
|
+
:class:`LayerAlignment` objects over the shared-layer set; tensors are fp32
|
|
617
|
+
on CPU. Raises :class:`AlignmentError` when fewer than
|
|
618
|
+
``min_shared_layers`` layers are common to both models — partial
|
|
619
|
+
alignment under that threshold tends to produce noisy transfers.
|
|
620
|
+
"""
|
|
621
|
+
materialized_shared = set(src_acts.keys()) & set(tgt_acts.keys())
|
|
622
|
+
available = (
|
|
623
|
+
materialized_shared if available_shared_layers is None
|
|
624
|
+
else {int(layer) for layer in available_shared_layers}
|
|
625
|
+
)
|
|
626
|
+
if len(available) < min_shared_layers:
|
|
627
|
+
raise AlignmentError(
|
|
628
|
+
f"alignment requires >= {min_shared_layers} shared layers; "
|
|
629
|
+
f"src={sorted(src_acts.keys())}, tgt={sorted(tgt_acts.keys())}"
|
|
630
|
+
)
|
|
631
|
+
shared = sorted(
|
|
632
|
+
materialized_shared if requested_layers is None else (
|
|
633
|
+
materialized_shared & {int(layer) for layer in requested_layers}
|
|
634
|
+
)
|
|
635
|
+
)
|
|
636
|
+
if not shared:
|
|
637
|
+
raise AlignmentError("alignment has no requested layers shared by both models")
|
|
638
|
+
|
|
639
|
+
out: dict[int, LayerAlignment] = {}
|
|
640
|
+
for layer in shared:
|
|
641
|
+
X_src = src_acts[layer].to(torch.float32)
|
|
642
|
+
X_tgt = tgt_acts[layer].to(torch.float32)
|
|
643
|
+
if X_src.shape[0] != X_tgt.shape[0]:
|
|
644
|
+
raise AlignmentError(
|
|
645
|
+
f"layer {layer}: src has N={X_src.shape[0]} prompts, "
|
|
646
|
+
f"tgt has N={X_tgt.shape[0]}; expected matched."
|
|
647
|
+
)
|
|
648
|
+
|
|
649
|
+
# Center both sides — Procrustes is translation-invariant only
|
|
650
|
+
# under shared origin.
|
|
651
|
+
src_mean = X_src.mean(dim=0)
|
|
652
|
+
tgt_mean = X_tgt.mean(dim=0)
|
|
653
|
+
X_src_c = X_src - src_mean
|
|
654
|
+
X_tgt_c = X_tgt - tgt_mean
|
|
655
|
+
|
|
656
|
+
D_src = X_src_c.shape[1]
|
|
657
|
+
D_tgt = X_tgt_c.shape[1]
|
|
658
|
+
|
|
659
|
+
if D_src == D_tgt:
|
|
660
|
+
# Low-rank orthogonal Procrustes. Factor the two row spaces first,
|
|
661
|
+
# then SVD only their <=N cross-core; the unobserved D-N complement
|
|
662
|
+
# has no evidence and is deliberately not invented/persisted.
|
|
663
|
+
Qs, Rs = torch.linalg.qr(X_src_c.transpose(0, 1), mode="reduced")
|
|
664
|
+
Qt, Rt = torch.linalg.qr(X_tgt_c.transpose(0, 1), mode="reduced")
|
|
665
|
+
U, S, Vh = torch.linalg.svd(Rt @ Rs.transpose(0, 1), full_matrices=False)
|
|
666
|
+
tol = torch.finfo(S.dtype).eps * max(D_src, X_src_c.shape[0]) * float(S.max())
|
|
667
|
+
rank = int((S > tol).sum())
|
|
668
|
+
if rank == 0:
|
|
669
|
+
raise AlignmentError(f"layer {layer}: centered alignment has rank 0")
|
|
670
|
+
left = (Qt @ U[:, :rank]).contiguous()
|
|
671
|
+
right = (Vh[:rank] @ Qs.transpose(0, 1)).contiguous()
|
|
672
|
+
else:
|
|
673
|
+
# Minimum-norm least squares in factored form:
|
|
674
|
+
# M = X_tgt^T U S^-1 V^T for X_src = U S V^T.
|
|
675
|
+
U, S, Vh = torch.linalg.svd(X_src_c, full_matrices=False)
|
|
676
|
+
tol = torch.finfo(S.dtype).eps * max(X_src_c.shape) * float(S.max())
|
|
677
|
+
rank = int((S > tol).sum())
|
|
678
|
+
if rank == 0:
|
|
679
|
+
raise AlignmentError(f"layer {layer}: centered alignment has rank 0")
|
|
680
|
+
left = (
|
|
681
|
+
X_tgt_c.transpose(0, 1) @ U[:, :rank]
|
|
682
|
+
).div(S[:rank].unsqueeze(0)).contiguous()
|
|
683
|
+
right = Vh[:rank].contiguous()
|
|
684
|
+
|
|
685
|
+
linear_src_mean = left @ (right @ src_mean)
|
|
686
|
+
offset = (tgt_mean - linear_src_mean).contiguous()
|
|
687
|
+
out[layer] = LayerAlignment(left, right, offset)
|
|
688
|
+
return out
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
def alignment_quality(
|
|
692
|
+
M: AlignmentMap,
|
|
693
|
+
src_acts: dict[int, torch.Tensor],
|
|
694
|
+
tgt_acts: dict[int, torch.Tensor],
|
|
695
|
+
) -> dict[int, float]:
|
|
696
|
+
"""Per-layer R² between the transferred src activations and tgt.
|
|
697
|
+
|
|
698
|
+
For each layer ``L`` shared by ``M``, computes
|
|
699
|
+
``1 - ||X_tgt - X_src @ M_L^T||^2 / ||X_tgt||^2`` on centered data.
|
|
700
|
+
Values near 1.0 mean the linear map captures the cross-model
|
|
701
|
+
geometry; values near 0.0 mean transferred probes will be noisy.
|
|
702
|
+
|
|
703
|
+
Surfaced through ``Sidecar.transfer_quality_estimate`` (median over
|
|
704
|
+
shared layers) so users see one summary number per transfer; the full
|
|
705
|
+
per-layer dict is exported in transfer sidecars and CLI JSON output for
|
|
706
|
+
callers that want it.
|
|
707
|
+
"""
|
|
708
|
+
out: dict[int, float] = {}
|
|
709
|
+
for layer, M_L in M.items():
|
|
710
|
+
X_src = src_acts[layer].to(torch.float32)
|
|
711
|
+
X_tgt = tgt_acts[layer].to(torch.float32)
|
|
712
|
+
X_src_c = X_src - X_src.mean(dim=0, keepdim=True)
|
|
713
|
+
X_tgt_c = X_tgt - X_tgt.mean(dim=0, keepdim=True)
|
|
714
|
+
# Translation cancels under centering; score the linear geometry.
|
|
715
|
+
X_pred = M_L.apply_vectors(X_src_c)
|
|
716
|
+
residual = (X_tgt_c - X_pred).pow(2).sum().item()
|
|
717
|
+
total = X_tgt_c.pow(2).sum().item()
|
|
718
|
+
if total <= 1e-12:
|
|
719
|
+
out[layer] = 0.0
|
|
720
|
+
else:
|
|
721
|
+
out[layer] = float(1.0 - residual / total)
|
|
722
|
+
return out
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
# ---------------------------------------------------------------------------
|
|
726
|
+
# Alignment-map disk cache.
|
|
727
|
+
# ---------------------------------------------------------------------------
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
def _alignment_anchor_paths(
|
|
731
|
+
src_model_id: str, tgt_model_id: str,
|
|
732
|
+
) -> tuple[Path, Path]:
|
|
733
|
+
"""Stable lock anchor and atomic v5 pointer sidecar."""
|
|
734
|
+
md = model_dir(tgt_model_id)
|
|
735
|
+
al_dir = md / "alignments"
|
|
736
|
+
src_safe = safe_model_id(src_model_id)
|
|
737
|
+
return (al_dir / f"{src_safe}.safetensors", al_dir / f"{src_safe}.json")
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
def alignment_cache_path(src_model_id: str, tgt_model_id: str) -> tuple[Path, Path]:
|
|
741
|
+
"""Representative shard and stable pointer path for an alignment cache."""
|
|
742
|
+
anchor, sidecar_path = _alignment_anchor_paths(src_model_id, tgt_model_id)
|
|
743
|
+
try:
|
|
744
|
+
with open(sidecar_path) as handle:
|
|
745
|
+
sidecar = json.load(handle)
|
|
746
|
+
files = sidecar.get("tensor_files")
|
|
747
|
+
layers = sidecar.get("shared_layers")
|
|
748
|
+
if isinstance(files, Mapping) and isinstance(layers, list) and layers:
|
|
749
|
+
filename = files.get(str(min(int(layer) for layer in layers)))
|
|
750
|
+
if isinstance(filename, str) and Path(filename).name == filename:
|
|
751
|
+
return anchor.parent / filename, sidecar_path
|
|
752
|
+
except (OSError, TypeError, ValueError, json.JSONDecodeError):
|
|
753
|
+
pass
|
|
754
|
+
return anchor, sidecar_path
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
def _alignment_shard_paths(
|
|
758
|
+
anchor: Path, sidecar: Mapping[str, Any], layers: list[int],
|
|
759
|
+
) -> dict[int, Path]:
|
|
760
|
+
return shard_paths(anchor, sidecar, layers, label=_ALIGNMENT_LABEL)
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
def _cleanup_alignment_generations(anchor: Path, sidecar: Mapping[str, Any]) -> None:
|
|
764
|
+
cleanup_generations(anchor, sidecar, label=_ALIGNMENT_LABEL)
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
@contextmanager
|
|
768
|
+
def alignment_fit_lock(src_model_id: str, tgt_model_id: str) -> Iterator[None]:
|
|
769
|
+
"""Single-flight a complete directional alignment fit, including loads."""
|
|
770
|
+
ts_path, _ = _alignment_anchor_paths(src_model_id, tgt_model_id)
|
|
771
|
+
with fit_lock(ts_path):
|
|
772
|
+
yield
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
def save_alignment_map(
|
|
776
|
+
M: AlignmentMap,
|
|
777
|
+
src_model_id: str,
|
|
778
|
+
tgt_model_id: str,
|
|
779
|
+
*,
|
|
780
|
+
source_identity: dict[str, Any],
|
|
781
|
+
target_identity: dict[str, Any],
|
|
782
|
+
quality_per_layer: dict[int, float] | None = None,
|
|
783
|
+
extend: bool = False,
|
|
784
|
+
) -> Path:
|
|
785
|
+
"""Persist a fitted alignment map.
|
|
786
|
+
|
|
787
|
+
Writes one bounded safetensors shard per layer, then atomically switches the
|
|
788
|
+
JSON pointer. Payload digests are computed from the exact bytes being
|
|
789
|
+
written, so publication never rereads a complete shard.
|
|
790
|
+
"""
|
|
791
|
+
anchor, sc_path = _alignment_anchor_paths(src_model_id, tgt_model_id)
|
|
792
|
+
anchor.parent.mkdir(parents=True, exist_ok=True)
|
|
793
|
+
|
|
794
|
+
normalized = {int(idx): value for idx, value in M.items()}
|
|
795
|
+
if not normalized:
|
|
796
|
+
raise ValueError("cannot save an empty alignment map")
|
|
797
|
+
from drowse.io.atomic import artifact_lock
|
|
798
|
+
|
|
799
|
+
with artifact_lock(anchor):
|
|
800
|
+
tensor_files: dict[str, str] = {}
|
|
801
|
+
tensor_sha256: dict[str, str] = {}
|
|
802
|
+
tensor_schema: dict[str, Any] = {}
|
|
803
|
+
merged_quality: dict[str, float | None] = {}
|
|
804
|
+
if extend and sc_path.exists():
|
|
805
|
+
try:
|
|
806
|
+
with open(sc_path) as handle:
|
|
807
|
+
current = json.load(handle)
|
|
808
|
+
if (
|
|
809
|
+
isinstance(current, dict)
|
|
810
|
+
and set(current) == _ALIGNMENT_SIDECAR_FIELDS
|
|
811
|
+
and current.get("format_version") == _ALIGNMENT_CACHE_FORMAT_VERSION
|
|
812
|
+
and current.get("method") == "sharded_factorized_affine_alignment"
|
|
813
|
+
and current.get("source_model_id") == src_model_id
|
|
814
|
+
and current.get("target_model_id") == tgt_model_id
|
|
815
|
+
and current.get("source_neutral_identity") == source_identity
|
|
816
|
+
and current.get("target_neutral_identity") == target_identity
|
|
817
|
+
):
|
|
818
|
+
current_layers = sorted(
|
|
819
|
+
int(layer) for layer in current.get("shared_layers", [])
|
|
820
|
+
)
|
|
821
|
+
current_paths = _alignment_shard_paths(
|
|
822
|
+
anchor, current, current_layers,
|
|
823
|
+
)
|
|
824
|
+
current_digests = current.get("tensor_sha256")
|
|
825
|
+
current_schema = current.get("tensor_schema")
|
|
826
|
+
if not isinstance(current_digests, Mapping) or not isinstance(
|
|
827
|
+
current_schema, Mapping,
|
|
828
|
+
):
|
|
829
|
+
raise ValueError("alignment pointer has no shard metadata")
|
|
830
|
+
for layer in current_layers:
|
|
831
|
+
try:
|
|
832
|
+
digest = current_digests.get(str(layer))
|
|
833
|
+
spec = current_schema.get(str(layer))
|
|
834
|
+
path = current_paths[layer]
|
|
835
|
+
if (
|
|
836
|
+
not isinstance(digest, str) or len(digest) != 64
|
|
837
|
+
or not isinstance(spec, Mapping) or not path.exists()
|
|
838
|
+
):
|
|
839
|
+
continue
|
|
840
|
+
# Header-only proof is enough here: this writer is
|
|
841
|
+
# under the artifact lock and carries the immutable
|
|
842
|
+
# generation forward byte-for-byte. The newly fitted
|
|
843
|
+
# mapping below replaces a damaged requested layer.
|
|
844
|
+
with safe_open(
|
|
845
|
+
str(path), framework="pt", device="cpu",
|
|
846
|
+
) as shard:
|
|
847
|
+
if set(shard.keys()) != {"left", "right", "offset"}:
|
|
848
|
+
continue
|
|
849
|
+
tensor_files[str(layer)] = path.name
|
|
850
|
+
tensor_sha256[str(layer)] = digest
|
|
851
|
+
tensor_schema[str(layer)] = dict(spec)
|
|
852
|
+
except (OSError, RuntimeError, ValueError, KeyError):
|
|
853
|
+
continue
|
|
854
|
+
raw_quality = current.get("quality_per_layer") or {}
|
|
855
|
+
if isinstance(raw_quality, Mapping):
|
|
856
|
+
merged_quality.update({
|
|
857
|
+
str(layer): float(value)
|
|
858
|
+
for layer, value in raw_quality.items()
|
|
859
|
+
if value is not None
|
|
860
|
+
})
|
|
861
|
+
except (OSError, TypeError, ValueError, KeyError, json.JSONDecodeError) as exc:
|
|
862
|
+
log.warning("could not extend current alignment generation: %s", exc)
|
|
863
|
+
tensor_files.clear()
|
|
864
|
+
tensor_sha256.clear()
|
|
865
|
+
tensor_schema.clear()
|
|
866
|
+
merged_quality.clear()
|
|
867
|
+
created: list[Path] = []
|
|
868
|
+
try:
|
|
869
|
+
for idx, alignment in sorted(normalized.items()):
|
|
870
|
+
path = generation_path(anchor, idx)
|
|
871
|
+
payload = save_safetensors({
|
|
872
|
+
"left": alignment.left.contiguous().cpu(),
|
|
873
|
+
"right": alignment.right.contiguous().cpu(),
|
|
874
|
+
"offset": alignment.offset.contiguous().cpu(),
|
|
875
|
+
})
|
|
876
|
+
write_bytes_atomic(path, payload)
|
|
877
|
+
created.append(path)
|
|
878
|
+
tensor_files[str(idx)] = path.name
|
|
879
|
+
tensor_sha256[str(idx)] = hashlib.sha256(payload).hexdigest()
|
|
880
|
+
tensor_schema[str(idx)] = {
|
|
881
|
+
"left": list(alignment.left.shape),
|
|
882
|
+
"right": list(alignment.right.shape),
|
|
883
|
+
"offset": list(alignment.offset.shape),
|
|
884
|
+
}
|
|
885
|
+
except BaseException:
|
|
886
|
+
for path in created:
|
|
887
|
+
path.unlink(missing_ok=True)
|
|
888
|
+
raise
|
|
889
|
+
sidecar: dict[str, Any] = {
|
|
890
|
+
"format_version": _ALIGNMENT_CACHE_FORMAT_VERSION,
|
|
891
|
+
"method": "sharded_factorized_affine_alignment",
|
|
892
|
+
"source_model_id": src_model_id,
|
|
893
|
+
"target_model_id": tgt_model_id,
|
|
894
|
+
"shared_layers": sorted(int(layer) for layer in tensor_files),
|
|
895
|
+
"tensor_schema": tensor_schema,
|
|
896
|
+
"source_neutral_identity": source_identity,
|
|
897
|
+
"target_neutral_identity": target_identity,
|
|
898
|
+
"tensor_files": tensor_files,
|
|
899
|
+
"tensor_sha256": tensor_sha256,
|
|
900
|
+
"quality_per_layer": {},
|
|
901
|
+
}
|
|
902
|
+
if quality_per_layer:
|
|
903
|
+
merged_quality.update({
|
|
904
|
+
str(layer): round(float(q), 6)
|
|
905
|
+
for layer, q in quality_per_layer.items()
|
|
906
|
+
})
|
|
907
|
+
for layer in sidecar["shared_layers"]:
|
|
908
|
+
merged_quality.setdefault(str(layer), None)
|
|
909
|
+
sidecar["quality_per_layer"] = merged_quality
|
|
910
|
+
if set(sidecar) != _ALIGNMENT_SIDECAR_FIELDS:
|
|
911
|
+
raise AssertionError("alignment writer produced a non-canonical sidecar")
|
|
912
|
+
try:
|
|
913
|
+
fsync_directory(sc_path.parent)
|
|
914
|
+
write_json_atomic(sc_path, sidecar)
|
|
915
|
+
except BaseException:
|
|
916
|
+
if not _json_pointer_matches(sc_path, sidecar):
|
|
917
|
+
for path in created:
|
|
918
|
+
path.unlink(missing_ok=True)
|
|
919
|
+
raise
|
|
920
|
+
# The pointer is now authoritative. If directory fsync itself fails,
|
|
921
|
+
# preserve the generations it names; deleting them here would turn a
|
|
922
|
+
# successfully replaced pointer into an immediately broken cache.
|
|
923
|
+
fsync_directory(sc_path.parent)
|
|
924
|
+
_cleanup_alignment_generations(anchor, sidecar)
|
|
925
|
+
fsync_directory(sc_path.parent)
|
|
926
|
+
return anchor.parent / tensor_files[str(min(int(layer) for layer in tensor_files))]
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
def load_alignment_map(
|
|
930
|
+
src_model_id: str, tgt_model_id: str,
|
|
931
|
+
*,
|
|
932
|
+
source_identity: dict[str, Any],
|
|
933
|
+
target_identity: dict[str, Any],
|
|
934
|
+
requested_layers: Iterable[int] | None = None,
|
|
935
|
+
) -> tuple[dict[int, LayerAlignment], dict[str, Any]] | None:
|
|
936
|
+
"""Load all or selected factor shards after identity/header preflight.
|
|
937
|
+
|
|
938
|
+
``requested_layers`` materializes only the requested intersection with the
|
|
939
|
+
cache's shared layers. The returned sidecar remains the complete pointer.
|
|
940
|
+
"""
|
|
941
|
+
|
|
942
|
+
anchor, sc_path = _alignment_anchor_paths(src_model_id, tgt_model_id)
|
|
943
|
+
from drowse.io.atomic import artifact_lock
|
|
944
|
+
|
|
945
|
+
with artifact_lock(anchor):
|
|
946
|
+
if not sc_path.exists():
|
|
947
|
+
return None
|
|
948
|
+
try:
|
|
949
|
+
with open(sc_path) as f:
|
|
950
|
+
sidecar = json.load(f)
|
|
951
|
+
if not isinstance(sidecar, dict) or set(sidecar) != _ALIGNMENT_SIDECAR_FIELDS:
|
|
952
|
+
return None
|
|
953
|
+
# Identity mismatch is the common stale-cache case. Reject it before
|
|
954
|
+
# hashing or materializing a potentially multi-GiB payload.
|
|
955
|
+
if (
|
|
956
|
+
sidecar.get("format_version") != _ALIGNMENT_CACHE_FORMAT_VERSION
|
|
957
|
+
or sidecar.get("method") != "sharded_factorized_affine_alignment"
|
|
958
|
+
or sidecar.get("source_model_id") != src_model_id
|
|
959
|
+
or sidecar.get("target_model_id") != tgt_model_id
|
|
960
|
+
or sidecar.get("source_neutral_identity") != source_identity
|
|
961
|
+
or sidecar.get("target_neutral_identity") != target_identity
|
|
962
|
+
):
|
|
963
|
+
return None
|
|
964
|
+
expected_layers = sidecar["shared_layers"]
|
|
965
|
+
schema = sidecar["tensor_schema"]
|
|
966
|
+
if (
|
|
967
|
+
not isinstance(expected_layers, list)
|
|
968
|
+
or not expected_layers
|
|
969
|
+
or any(
|
|
970
|
+
isinstance(layer, bool) or not isinstance(layer, int) or layer < 0
|
|
971
|
+
for layer in expected_layers
|
|
972
|
+
)
|
|
973
|
+
or expected_layers != sorted(set(expected_layers))
|
|
974
|
+
or not isinstance(schema, dict)
|
|
975
|
+
or set(schema) != {str(layer) for layer in expected_layers}
|
|
976
|
+
or not isinstance(sidecar["quality_per_layer"], dict)
|
|
977
|
+
):
|
|
978
|
+
return None
|
|
979
|
+
all_layers = expected_layers
|
|
980
|
+
paths = _alignment_shard_paths(anchor, sidecar, all_layers)
|
|
981
|
+
digests = sidecar.get("tensor_sha256")
|
|
982
|
+
layer_keys = {str(layer) for layer in all_layers}
|
|
983
|
+
quality = sidecar["quality_per_layer"]
|
|
984
|
+
if (
|
|
985
|
+
not isinstance(digests, Mapping)
|
|
986
|
+
or set(digests) != layer_keys
|
|
987
|
+
or set(quality) != layer_keys
|
|
988
|
+
or any(
|
|
989
|
+
value is not None and (
|
|
990
|
+
not isinstance(value, (int, float))
|
|
991
|
+
or isinstance(value, bool)
|
|
992
|
+
or not math.isfinite(float(value))
|
|
993
|
+
)
|
|
994
|
+
for value in quality.values()
|
|
995
|
+
)
|
|
996
|
+
):
|
|
997
|
+
return None
|
|
998
|
+
# Validate declared headers independently before payload materialization.
|
|
999
|
+
# One damaged layer must remain repairable without discarding the
|
|
1000
|
+
# pointer metadata for unrelated immutable factors.
|
|
1001
|
+
valid_headers: set[int] = set()
|
|
1002
|
+
for layer in all_layers:
|
|
1003
|
+
spec = schema.get(str(layer), {})
|
|
1004
|
+
digest = digests.get(str(layer))
|
|
1005
|
+
if (
|
|
1006
|
+
not isinstance(spec, dict)
|
|
1007
|
+
or set(spec) != {"left", "right", "offset"}
|
|
1008
|
+
or any(
|
|
1009
|
+
not isinstance(spec[part], list)
|
|
1010
|
+
or not spec[part]
|
|
1011
|
+
or any(
|
|
1012
|
+
isinstance(dim, bool) or not isinstance(dim, int)
|
|
1013
|
+
or dim <= 0 for dim in spec[part]
|
|
1014
|
+
)
|
|
1015
|
+
for part in ("left", "right", "offset")
|
|
1016
|
+
)
|
|
1017
|
+
or len(spec["left"]) != 2
|
|
1018
|
+
or len(spec["right"]) != 2
|
|
1019
|
+
or len(spec["offset"]) != 1
|
|
1020
|
+
or spec["left"][1] != spec["right"][0]
|
|
1021
|
+
or spec["left"][0] != spec["offset"][0]
|
|
1022
|
+
or not isinstance(digest, str)
|
|
1023
|
+
or len(digest) != 64
|
|
1024
|
+
or any(char not in "0123456789abcdef" for char in digest)
|
|
1025
|
+
or not paths[layer].exists()
|
|
1026
|
+
):
|
|
1027
|
+
continue
|
|
1028
|
+
try:
|
|
1029
|
+
with safe_open(
|
|
1030
|
+
str(paths[layer]), framework="pt", device="cpu",
|
|
1031
|
+
) as shard:
|
|
1032
|
+
if set(shard.keys()) != {"left", "right", "offset"}:
|
|
1033
|
+
continue
|
|
1034
|
+
if any(
|
|
1035
|
+
list(shard.get_slice(part).get_shape()) != spec.get(part)
|
|
1036
|
+
or shard.get_slice(part).get_dtype() != "F32"
|
|
1037
|
+
for part in ("left", "right", "offset")
|
|
1038
|
+
):
|
|
1039
|
+
continue
|
|
1040
|
+
valid_headers.add(layer)
|
|
1041
|
+
except (OSError, RuntimeError, ValueError, KeyError):
|
|
1042
|
+
continue
|
|
1043
|
+
selected = (
|
|
1044
|
+
all_layers if requested_layers is None else sorted(
|
|
1045
|
+
set(all_layers) & {int(layer) for layer in requested_layers}
|
|
1046
|
+
)
|
|
1047
|
+
)
|
|
1048
|
+
M: dict[int, LayerAlignment] = {}
|
|
1049
|
+
for layer in selected:
|
|
1050
|
+
if layer not in valid_headers:
|
|
1051
|
+
continue
|
|
1052
|
+
try:
|
|
1053
|
+
payload = paths[layer].read_bytes()
|
|
1054
|
+
if hashlib.sha256(payload).hexdigest() != digests[str(layer)]:
|
|
1055
|
+
continue
|
|
1056
|
+
tensors = load_safetensors(payload)
|
|
1057
|
+
left = tensors["left"]
|
|
1058
|
+
right = tensors["right"]
|
|
1059
|
+
offset = tensors["offset"]
|
|
1060
|
+
if (
|
|
1061
|
+
left.ndim != 2 or right.ndim != 2 or offset.ndim != 1
|
|
1062
|
+
or left.shape[1] != right.shape[0]
|
|
1063
|
+
or left.shape[0] != offset.shape[0]
|
|
1064
|
+
or not all(
|
|
1065
|
+
bool(torch.isfinite(t).all())
|
|
1066
|
+
for t in (left, right, offset)
|
|
1067
|
+
)
|
|
1068
|
+
):
|
|
1069
|
+
continue
|
|
1070
|
+
M[layer] = LayerAlignment(left, right, offset)
|
|
1071
|
+
except (OSError, RuntimeError, ValueError, KeyError):
|
|
1072
|
+
continue
|
|
1073
|
+
_cleanup_alignment_generations(anchor, sidecar)
|
|
1074
|
+
return M, sidecar
|
|
1075
|
+
except Exception as e:
|
|
1076
|
+
log.warning(
|
|
1077
|
+
"Corrupt alignment map cache (%s → %s): %s",
|
|
1078
|
+
src_model_id, tgt_model_id, e,
|
|
1079
|
+
)
|
|
1080
|
+
return None
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
# ---------------------------------------------------------------------------
|
|
1084
|
+
# Transfer-alignment orchestration
|
|
1085
|
+
# ---------------------------------------------------------------------------
|
|
1086
|
+
#
|
|
1087
|
+
# Single-flight locking + cache-proof + retry-on-race orchestration that loads
|
|
1088
|
+
# or fits a complete source->target Procrustes alignment and returns the
|
|
1089
|
+
# identity-matched target metric. Promoted out of the CLI layer so it lives
|
|
1090
|
+
# beside the primitives it wraps (``load_alignment_map`` /
|
|
1091
|
+
# ``validate_neutral_cache_metadata`` / ``fit_alignment`` / ``save_alignment_map``).
|
|
1092
|
+
# Concurrency semantics (locking order, proof-checking without payload hashing,
|
|
1093
|
+
# roster narrowing, model-construction avoidance on cache hit, retry-on-race
|
|
1094
|
+
# recursion) are load-bearing and documented in ``io/AGENTS.md``.
|
|
1095
|
+
|
|
1096
|
+
|
|
1097
|
+
def _target_whitener_from_neutral_activations(
|
|
1098
|
+
activations: dict[int, Any],
|
|
1099
|
+
) -> Any:
|
|
1100
|
+
"""Build the transfer target metric from an already-proven row roster."""
|
|
1101
|
+
from drowse.core.mahalanobis import LayerWhitener
|
|
1102
|
+
|
|
1103
|
+
return LayerWhitener.from_neutral_activations(
|
|
1104
|
+
activations,
|
|
1105
|
+
{
|
|
1106
|
+
layer: tensor.mean(dim=0)
|
|
1107
|
+
for layer, tensor in activations.items()
|
|
1108
|
+
},
|
|
1109
|
+
)
|
|
1110
|
+
|
|
1111
|
+
|
|
1112
|
+
def load_or_fit_transfer_alignment(
|
|
1113
|
+
src_model: str,
|
|
1114
|
+
tgt_model: str,
|
|
1115
|
+
*,
|
|
1116
|
+
force: bool,
|
|
1117
|
+
label: str,
|
|
1118
|
+
requested_layers: "Sequence[int] | None" = None,
|
|
1119
|
+
) -> tuple[
|
|
1120
|
+
dict[int, Any], dict[int, float], Path, dict[str, Any], dict[str, Any], Any,
|
|
1121
|
+
dict[int, Any],
|
|
1122
|
+
]:
|
|
1123
|
+
"""Single-flight a complete alignment plus its target metric."""
|
|
1124
|
+
with alignment_fit_lock(src_model, tgt_model):
|
|
1125
|
+
return _load_or_fit_transfer_alignment_locked(
|
|
1126
|
+
src_model, tgt_model, force=force, label=label,
|
|
1127
|
+
requested_layers=requested_layers,
|
|
1128
|
+
)
|
|
1129
|
+
|
|
1130
|
+
|
|
1131
|
+
def _load_or_fit_transfer_alignment_locked(
|
|
1132
|
+
src_model: str,
|
|
1133
|
+
tgt_model: str,
|
|
1134
|
+
*,
|
|
1135
|
+
force: bool,
|
|
1136
|
+
label: str,
|
|
1137
|
+
requested_layers: "Sequence[int] | None" = None,
|
|
1138
|
+
) -> tuple[
|
|
1139
|
+
dict[int, Any], dict[int, float], Path, dict[str, Any], dict[str, Any], Any,
|
|
1140
|
+
dict[int, Any],
|
|
1141
|
+
]:
|
|
1142
|
+
"""Load or fit an alignment and return its identity-matched target whitener."""
|
|
1143
|
+
from drowse.core.model import model_source_fingerprint
|
|
1144
|
+
from drowse.core.session import DrowseSession
|
|
1145
|
+
|
|
1146
|
+
wanted_arg = (
|
|
1147
|
+
None if requested_layers is None
|
|
1148
|
+
else {int(layer) for layer in requested_layers}
|
|
1149
|
+
)
|
|
1150
|
+
|
|
1151
|
+
def _proven_sidecar(model_id: str) -> dict[str, Any] | None:
|
|
1152
|
+
"""Prove cache/source identity without hashing any tensor payload."""
|
|
1153
|
+
try:
|
|
1154
|
+
source = model_source_fingerprint(model_id)
|
|
1155
|
+
if source is None:
|
|
1156
|
+
return None
|
|
1157
|
+
sidecar = validate_neutral_cache_metadata(
|
|
1158
|
+
model_id, verify_payload=False,
|
|
1159
|
+
)
|
|
1160
|
+
if sidecar.get("model_source_fingerprint") != source:
|
|
1161
|
+
return None
|
|
1162
|
+
return sidecar
|
|
1163
|
+
except (OSError, RuntimeError, ValueError, TypeError, KeyError):
|
|
1164
|
+
return None
|
|
1165
|
+
|
|
1166
|
+
def _load_proven_rows(
|
|
1167
|
+
model_id: str, layers: set[int] | None,
|
|
1168
|
+
) -> tuple[dict[int, Any], dict[str, Any]] | None:
|
|
1169
|
+
before = _proven_sidecar(model_id)
|
|
1170
|
+
if before is None:
|
|
1171
|
+
return None
|
|
1172
|
+
try:
|
|
1173
|
+
rows, after = load_validated_neutral_cache(
|
|
1174
|
+
model_id, requested_layers=layers,
|
|
1175
|
+
)
|
|
1176
|
+
except (OSError, RuntimeError, ValueError, TypeError, KeyError):
|
|
1177
|
+
return None
|
|
1178
|
+
if neutral_cache_identity(before) != neutral_cache_identity(after):
|
|
1179
|
+
return None
|
|
1180
|
+
return rows, after
|
|
1181
|
+
|
|
1182
|
+
def _load_or_capture_rows(
|
|
1183
|
+
model_id: str, layers: set[int] | None,
|
|
1184
|
+
) -> tuple[dict[int, Any], dict[str, Any]]:
|
|
1185
|
+
cached_rows = _load_proven_rows(model_id, layers)
|
|
1186
|
+
if cached_rows is not None:
|
|
1187
|
+
return cached_rows
|
|
1188
|
+
# Single-flight starts before model construction, not merely before the
|
|
1189
|
+
# neutral forward. Two directional transfers sharing a cold model cache
|
|
1190
|
+
# therefore incur one large model load as well as one capture.
|
|
1191
|
+
with neutral_fit_lock(model_id):
|
|
1192
|
+
cached_rows = _load_proven_rows(model_id, layers)
|
|
1193
|
+
if cached_rows is not None:
|
|
1194
|
+
return cached_rows
|
|
1195
|
+
with DrowseSession.from_pretrained(
|
|
1196
|
+
model_id, device="auto", probes=[],
|
|
1197
|
+
) as session:
|
|
1198
|
+
all_rows, sidecar = (
|
|
1199
|
+
_load_or_compute_neutral_activations_with_metadata_locked(
|
|
1200
|
+
session.model, session.tokenizer, session.layers,
|
|
1201
|
+
model_id=model_id, force=False,
|
|
1202
|
+
)
|
|
1203
|
+
)
|
|
1204
|
+
if layers is None:
|
|
1205
|
+
return all_rows, sidecar
|
|
1206
|
+
return (
|
|
1207
|
+
{layer: value for layer, value in all_rows.items() if layer in layers},
|
|
1208
|
+
sidecar,
|
|
1209
|
+
)
|
|
1210
|
+
|
|
1211
|
+
src_sidecar = _proven_sidecar(src_model)
|
|
1212
|
+
tgt_sidecar = _proven_sidecar(tgt_model)
|
|
1213
|
+
src_seed_rows: dict[int, Any] | None = None
|
|
1214
|
+
tgt_seed_rows: dict[int, Any] | None = None
|
|
1215
|
+
if src_sidecar is None:
|
|
1216
|
+
src_seed_rows, src_sidecar = _load_or_capture_rows(src_model, None)
|
|
1217
|
+
if tgt_sidecar is None:
|
|
1218
|
+
tgt_seed_rows, tgt_sidecar = _load_or_capture_rows(tgt_model, None)
|
|
1219
|
+
|
|
1220
|
+
src_identity = neutral_cache_identity(src_sidecar)
|
|
1221
|
+
tgt_identity = neutral_cache_identity(tgt_sidecar)
|
|
1222
|
+
expected_tgt_identity = tgt_identity
|
|
1223
|
+
available = set(int(layer) for layer in src_sidecar.get("layers", [])) & set(
|
|
1224
|
+
int(layer) for layer in tgt_sidecar.get("layers", [])
|
|
1225
|
+
)
|
|
1226
|
+
wanted = available if wanted_arg is None else (available & wanted_arg)
|
|
1227
|
+
if not wanted:
|
|
1228
|
+
sys.stderr.write(
|
|
1229
|
+
f"{label}: source and target have no requested shared layers\n"
|
|
1230
|
+
)
|
|
1231
|
+
sys.exit(1)
|
|
1232
|
+
|
|
1233
|
+
# A cold cache fill necessarily captures the model's full neutral roster,
|
|
1234
|
+
# but a narrow transfer must not retain every layer from both models for
|
|
1235
|
+
# the rest of the transaction. Rebinding here drops unrequested tensor
|
|
1236
|
+
# owners as soon as shared coverage is known.
|
|
1237
|
+
if src_seed_rows is not None:
|
|
1238
|
+
src_seed_rows = {layer: src_seed_rows[layer] for layer in wanted}
|
|
1239
|
+
if tgt_seed_rows is not None:
|
|
1240
|
+
tgt_seed_rows = {layer: tgt_seed_rows[layer] for layer in wanted}
|
|
1241
|
+
|
|
1242
|
+
cached = load_alignment_map(
|
|
1243
|
+
src_model, tgt_model,
|
|
1244
|
+
source_identity=src_identity, target_identity=tgt_identity,
|
|
1245
|
+
requested_layers=(set() if force else wanted),
|
|
1246
|
+
)
|
|
1247
|
+
cached_M: dict[int, Any] = {}
|
|
1248
|
+
cached_sidecar: dict[str, Any] = {}
|
|
1249
|
+
if cached is not None:
|
|
1250
|
+
cached_M, cached_sidecar = cached
|
|
1251
|
+
complete_hit = not force and set(cached_M) >= wanted
|
|
1252
|
+
if complete_hit:
|
|
1253
|
+
# The cached map proves the source side; only the target rows are still
|
|
1254
|
+
# needed to reconstruct the exact target metric.
|
|
1255
|
+
src_seed_rows = None
|
|
1256
|
+
|
|
1257
|
+
# Target rows are always needed for the exact target-metric re-bake, but
|
|
1258
|
+
# only for layers the source profile can actually transfer.
|
|
1259
|
+
tgt_loaded = (
|
|
1260
|
+
({layer: tgt_seed_rows[layer] for layer in wanted}, tgt_sidecar)
|
|
1261
|
+
if tgt_seed_rows is not None else _load_proven_rows(tgt_model, wanted)
|
|
1262
|
+
)
|
|
1263
|
+
if tgt_loaded is None:
|
|
1264
|
+
tgt_acts, tgt_sidecar = _load_or_capture_rows(tgt_model, wanted)
|
|
1265
|
+
else:
|
|
1266
|
+
tgt_acts, tgt_sidecar = tgt_loaded
|
|
1267
|
+
tgt_seed_rows = None
|
|
1268
|
+
if neutral_cache_identity(tgt_sidecar) != expected_tgt_identity:
|
|
1269
|
+
# A cache writer raced the metadata preflight. Restart this directional
|
|
1270
|
+
# transaction under the outer alignment fit lock with the new identity.
|
|
1271
|
+
return _load_or_fit_transfer_alignment_locked(
|
|
1272
|
+
src_model, tgt_model, force=force, label=label,
|
|
1273
|
+
requested_layers=requested_layers,
|
|
1274
|
+
)
|
|
1275
|
+
|
|
1276
|
+
raw_q = cached_sidecar.get("quality_per_layer") or {}
|
|
1277
|
+
quality_per_layer = {int(k): float(v) for k, v in raw_q.items()}
|
|
1278
|
+
map_path, _ = alignment_cache_path(src_model, tgt_model)
|
|
1279
|
+
if complete_hit:
|
|
1280
|
+
selected_quality = {
|
|
1281
|
+
layer: quality_per_layer[layer]
|
|
1282
|
+
for layer in sorted(wanted) if layer in quality_per_layer
|
|
1283
|
+
}
|
|
1284
|
+
return (
|
|
1285
|
+
{layer: cached_M[layer] for layer in sorted(wanted)},
|
|
1286
|
+
selected_quality, map_path, src_identity, expected_tgt_identity,
|
|
1287
|
+
_target_whitener_from_neutral_activations(tgt_acts),
|
|
1288
|
+
{layer: tensor.mean(dim=0) for layer, tensor in tgt_acts.items()},
|
|
1289
|
+
)
|
|
1290
|
+
|
|
1291
|
+
missing = wanted if force else (wanted - set(cached_M))
|
|
1292
|
+
src_loaded = (
|
|
1293
|
+
({layer: src_seed_rows[layer] for layer in missing}, src_sidecar)
|
|
1294
|
+
if src_seed_rows is not None else _load_proven_rows(src_model, missing)
|
|
1295
|
+
)
|
|
1296
|
+
if src_loaded is None:
|
|
1297
|
+
src_acts, src_sidecar = _load_or_capture_rows(src_model, missing)
|
|
1298
|
+
else:
|
|
1299
|
+
src_acts, src_sidecar = src_loaded
|
|
1300
|
+
src_seed_rows = None
|
|
1301
|
+
if neutral_cache_identity(src_sidecar) != src_identity:
|
|
1302
|
+
return _load_or_fit_transfer_alignment_locked(
|
|
1303
|
+
src_model, tgt_model, force=force, label=label,
|
|
1304
|
+
requested_layers=requested_layers,
|
|
1305
|
+
)
|
|
1306
|
+
tgt_missing = {layer: tgt_acts[layer] for layer in missing}
|
|
1307
|
+
try:
|
|
1308
|
+
fitted = fit_alignment(
|
|
1309
|
+
src_acts, tgt_missing,
|
|
1310
|
+
requested_layers=missing,
|
|
1311
|
+
available_shared_layers=available,
|
|
1312
|
+
)
|
|
1313
|
+
except AlignmentError as e:
|
|
1314
|
+
sys.stderr.write(f"{label}: {e}\n")
|
|
1315
|
+
sys.exit(1)
|
|
1316
|
+
fitted_quality = alignment_quality(fitted, src_acts, tgt_missing)
|
|
1317
|
+
quality_per_layer.update(fitted_quality)
|
|
1318
|
+
map_path = save_alignment_map(
|
|
1319
|
+
fitted, src_model, tgt_model,
|
|
1320
|
+
source_identity=src_identity, target_identity=tgt_identity,
|
|
1321
|
+
quality_per_layer=fitted_quality, extend=bool(cached_sidecar),
|
|
1322
|
+
)
|
|
1323
|
+
result_M = dict(cached_M)
|
|
1324
|
+
result_M.update(fitted)
|
|
1325
|
+
selected_quality = {
|
|
1326
|
+
layer: quality_per_layer[layer]
|
|
1327
|
+
for layer in sorted(wanted) if layer in quality_per_layer
|
|
1328
|
+
}
|
|
1329
|
+
return (
|
|
1330
|
+
{layer: result_M[layer] for layer in sorted(wanted)},
|
|
1331
|
+
selected_quality, map_path, src_identity, expected_tgt_identity,
|
|
1332
|
+
_target_whitener_from_neutral_activations(tgt_acts),
|
|
1333
|
+
{layer: tensor.mean(dim=0) for layer, tensor in tgt_acts.items()},
|
|
1334
|
+
)
|