{
  "schema_version": 1,
  "captured_kst": "2026-10-08 00:17:00 KST",
  "repository_root": "/home/work/Projects/Raina-laya",
  "repository_head": "22776220a7cf65cb69a19ef8741916401aaed7df",
  "state_snapshot": {
    "path": "/home/work/Projects/Raina-laya/artifacts/champion-loop/state.json",
    "sha256": "59c341fbec5424d649a542229ab873494155e9d74b538dd48833f40f59e73869",
    "updated": "2026-10-08 00:13:16 KST",
    "generation": 14,
    "champion_run_id": "champ-g014-r0005-dst_a05",
    "champion_candidate": "dst_a05",
    "champion_epoch": 50
  },
  "original_muq": {
    "repository": "OpenMuQ/MuQ-large-msd-iter",
    "cached_revision": "0562a57814f6f8bbd9fdea0a25921a2fce1a841a",
    "hidden_width": 1024,
    "encoder_depth": 12,
    "raw_hidden_state_count": 13,
    "standalone_weight_equality_verified": false,
    "config_path": "/home/work/Projects/Raina-laya/model/raina-laya-best-20261001/huggingface/hub/models--OpenMuQ--MuQ-large-msd-iter/snapshots/0562a57814f6f8bbd9fdea0a25921a2fce1a841a/config.json",
    "config_sha256": "237335ee27d8fb951ce778701a12a79e06c51ae636dd786f97e45f51ce532543"
  },
  "loader_route": {
    "wrapper_repository": "OpenMuQ/MuQ-MuLan-large",
    "wrapper_revision": "2e01c796b71dca71b45251384c04cd7b237c9020",
    "wrapper_config_path": "/home/work/Projects/Raina-laya/model/raina-laya-best-20261001/huggingface/hub/models--OpenMuQ--MuQ-MuLan-large/snapshots/2e01c796b71dca71b45251384c04cd7b237c9020/config.json",
    "wrapper_config_sha256": "8fefc545ef87ecd9bcde7417dd03464370c48c321f36dcff20266a752079e468",
    "inner_model_path": "root.mulan.audio.model",
    "inner_model_class": "MuQ",
    "raw_output": "hidden_states",
    "mulan_audio_projection_used": false,
    "mulan_global_embedding_used": false,
    "text_encoder_output_used": false
  },
  "pinned_champion": {
    "run_id": "champ-g014-r0005-dst_a05",
    "candidate": "dst_a05",
    "epoch": 50,
    "config_path": "/home/work/Projects/Raina-laya/artifacts/champion-loop/configs/gen-014/round-0005/dst_a05.yaml",
    "config_sha256": "1ea8eab891e4d71820212529edc2183dd7d748acac42d14a3c8ec41d547d3def",
    "checkpoint_path": "/home/work/Projects/Raina-laya/artifacts/training-runs/champ-g014-r0005-dst_a05/epoch-0050.ckpt",
    "checkpoint_sha256": "08bbc8246d09ecb336723fb08876163cc1e73138300a2804059f6d1a2cc44547",
    "checkpoint_metadata": {
      "model_family": "raina_laya_hierarchical_v5",
      "model_width": 256,
      "transformer_depth": 2,
      "transformer_dropout": 0.3,
      "embedding_layers": null,
      "raw_output_roles": [
        "fail_gate_score",
        "pass_gate_score",
        "s_given_pass_logit"
      ],
      "rl_weight": 0.0,
      "gate_soft_target_mix": 0.5
    },
    "feature_projection_weight_shape": [
      256,
      2048
    ],
    "query_token_parameter_shape": [
      3,
      256
    ],
    "head_input_width": 2048,
    "embedding_layers_effective": [
      10,
      9
    ],
    "embedding_layers_explicit": false,
    "embedding_database": "/home/work/Projects/Raina-laya/artifacts/sqlite/raina-laya-20261005-expert-regrade.sqlite3"
  },
  "single_layer_candidate": {
    "run_id": "champ-g014-r0008-l11_k8",
    "checkpoint_path": "/home/work/Projects/Raina-laya/artifacts/training-runs/champ-g014-r0008-l11_k8/epoch-0049.ckpt",
    "checkpoint_sha256": "05534e6a78afd0aa29173829131dbc4db05ed27bae4e0f78ee622881296f5b4b",
    "epoch": 49,
    "embedding_layers": [
      11
    ],
    "feature_projection_weight_shape": [
      256,
      1024
    ],
    "query_token_parameter_shape": [
      3,
      256
    ],
    "head_input_width": 1024,
    "embedding_database": "/home/work/Projects/Raina-laya/artifacts/sqlite/muq-layers-20261007/layer-11.sqlite3"
  },
  "latest_generated_configs": [
    {
      "candidate": "k8_do30",
      "path": "/home/work/Projects/Raina-laya/artifacts/champion-loop/configs/gen-014/round-0008/k8_do30.yaml",
      "sha256": "923b1e3422dc0ce3cfe2d1fcb7fd5cbc898dbaa71a6e3845e5e19394b76ac0fc",
      "excerpts": [
        {
          "line": 1,
          "source": "model_family: raina_laya_hierarchical_v5"
        },
        {
          "line": 2,
          "source": "model_width: 256"
        },
        {
          "line": 19,
          "source": "embedding_database: artifacts/sqlite/raina-laya-20261005-expert-regrade.sqlite3"
        }
      ]
    },
    {
      "candidate": "l9_k8",
      "path": "/home/work/Projects/Raina-laya/artifacts/champion-loop/configs/gen-014/round-0008/l9_k8.yaml",
      "sha256": "1f3209bb1e602716e8d2856ea350385b2acdba37460373fd52ac4ee7b127622c",
      "excerpts": [
        {
          "line": 1,
          "source": "model_family: raina_laya_hierarchical_v5"
        },
        {
          "line": 2,
          "source": "model_width: 256"
        },
        {
          "line": 19,
          "source": "embedding_database: artifacts/sqlite/raina-laya-20261005-expert-regrade.sqlite3"
        },
        {
          "line": 44,
          "source": "embedding_layer_dir: artifacts/sqlite/muq-layers-20261007"
        },
        {
          "line": 45,
          "source": "embedding_layers:"
        },
        {
          "line": 46,
          "source": "- 9"
        }
      ]
    },
    {
      "candidate": "l10_k8",
      "path": "/home/work/Projects/Raina-laya/artifacts/champion-loop/configs/gen-014/round-0008/l10_k8.yaml",
      "sha256": "6f5223e6fbc619257fb52fc5959f73180b3f0eed0d0af99f7ff00e7b6d2471ab",
      "excerpts": [
        {
          "line": 1,
          "source": "model_family: raina_laya_hierarchical_v5"
        },
        {
          "line": 2,
          "source": "model_width: 256"
        },
        {
          "line": 19,
          "source": "embedding_database: artifacts/sqlite/raina-laya-20261005-expert-regrade.sqlite3"
        },
        {
          "line": 44,
          "source": "embedding_layer_dir: artifacts/sqlite/muq-layers-20261007"
        },
        {
          "line": 45,
          "source": "embedding_layers:"
        },
        {
          "line": 46,
          "source": "- 10"
        }
      ]
    },
    {
      "candidate": "l11_k8",
      "path": "/home/work/Projects/Raina-laya/artifacts/champion-loop/configs/gen-014/round-0008/l11_k8.yaml",
      "sha256": "a384f284c434b57ce69b2dbd5b1da7f29a0edaf9fb951e1b8820456107ce22a1",
      "excerpts": [
        {
          "line": 1,
          "source": "model_family: raina_laya_hierarchical_v5"
        },
        {
          "line": 2,
          "source": "model_width: 256"
        },
        {
          "line": 19,
          "source": "embedding_database: artifacts/sqlite/raina-laya-20261005-expert-regrade.sqlite3"
        },
        {
          "line": 44,
          "source": "embedding_layer_dir: artifacts/sqlite/muq-layers-20261007"
        },
        {
          "line": 45,
          "source": "embedding_layers:"
        },
        {
          "line": 46,
          "source": "- 11"
        }
      ]
    },
    {
      "candidate": "l89_k8",
      "path": "/home/work/Projects/Raina-laya/artifacts/champion-loop/configs/gen-014/round-0008/l89_k8.yaml",
      "sha256": "706dcc95ebf20b975f28d78e529f6d30b395ef23a9eb1c6097cd06f3db6a8d28",
      "excerpts": [
        {
          "line": 1,
          "source": "model_family: raina_laya_hierarchical_v5"
        },
        {
          "line": 2,
          "source": "model_width: 256"
        },
        {
          "line": 19,
          "source": "embedding_database: artifacts/sqlite/raina-laya-20261005-expert-regrade.sqlite3"
        },
        {
          "line": 44,
          "source": "embedding_layer_dir: artifacts/sqlite/muq-layers-20261007"
        },
        {
          "line": 45,
          "source": "embedding_layers:"
        },
        {
          "line": 46,
          "source": "- 8"
        },
        {
          "line": 47,
          "source": "- 9"
        }
      ]
    }
  ],
  "database_evidence": [
    {
      "path": "/home/work/Projects/Raina-laya/artifacts/sqlite/raina-laya-20261005-expert-regrade.sqlite3",
      "size_bytes": 21024366592,
      "metadata_query": "SELECT backbone_repository, backbone_revision, layer_0, layer_1 FROM embedding_records LIMIT 1",
      "metadata": {
        "backbone_repository": "OpenMuQ/MuQ-MuLan-large",
        "backbone_revision": "2e01c796b71dca71b45251384c04cd7b237c9020",
        "layer_0": 10,
        "layer_1": 9
      },
      "feature_query": "SELECT token_count, length(feature_blob), length(feature_blob) / token_count / 4 FROM embedding_records LIMIT 3",
      "samples": [
        {
          "token_count": 45,
          "feature_bytes": 368640,
          "feature_width": 2048
        },
        {
          "token_count": 58,
          "feature_bytes": 475136,
          "feature_width": 2048
        },
        {
          "token_count": 62,
          "feature_bytes": 507904,
          "feature_width": 2048
        }
      ],
      "sha256": "94960b55521a4e9d1fb8659fbcdc839116420eca64433ea3e384603ac74c9831"
    },
    {
      "path": "/home/work/Projects/Raina-laya/artifacts/sqlite/muq-layers-20261007/layer-11.sqlite3",
      "size_bytes": 10579521536,
      "metadata_query": "SELECT format_version, layer, width, schema_version, backbone_repository, backbone_revision, policy_fingerprint FROM store_metadata",
      "metadata": {
        "format_version": 1,
        "layer": 11,
        "width": 1024,
        "schema_version": "temporal_features_v1",
        "backbone_repository": "OpenMuQ/MuQ-MuLan-large",
        "backbone_revision": "2e01c796b71dca71b45251384c04cd7b237c9020",
        "policy_fingerprint": "4d481713a614e925"
      },
      "feature_query": "SELECT token_count, length(feature_blob), length(feature_blob) / token_count / 4 FROM embedding_records LIMIT 3",
      "samples": [
        {
          "token_count": 40,
          "feature_bytes": 163840,
          "feature_width": 1024
        },
        {
          "token_count": 61,
          "feature_bytes": 249856,
          "feature_width": 1024
        },
        {
          "token_count": 45,
          "feature_bytes": 184320,
          "feature_width": 1024
        }
      ],
      "sha256": "d22ff6fe763e733d2cae6367f32da320e72ffcd5b6c81ea0c1d081dc9ee58ab9"
    }
  ],
  "package_provenance": {
    "path": "/home/work/Projects/Raina-laya/model/raina-laya-v5-g014-champ-g014-r0005-dst_a05-e0050/provenance.json",
    "sha256": "f56c5c73b5416289bf41e10c51613ca981dbb4bb0a2dbeb1457707bc6130d207"
  },
  "source_evidence": [
    {
      "id": "repo_loader",
      "path": "/home/work/Projects/Raina-laya/src/raina_laya/features/audio_features/infrastructure/features.py",
      "sha256": "75f22e9164b4a10fec27fa2f3cb118656ea103c641fbf20f59370e8815f8318e",
      "excerpts": [
        {
          "start_line": 26,
          "end_line": 33,
          "lines": [
            {
              "line": 26,
              "source": "BACKBONE: Final = MuQBackbone("
            },
            {
              "line": 27,
              "source": "    repository=\"OpenMuQ/MuQ-MuLan-large\","
            },
            {
              "line": 28,
              "source": "    revision=\"2e01c796b71dca71b45251384c04cd7b237c9020\","
            },
            {
              "line": 29,
              "source": "    inner_path=\"model.mulan.audio.model\","
            },
            {
              "line": 30,
              "source": "    layer_order=(10, 9),"
            },
            {
              "line": 31,
              "source": ")"
            },
            {
              "line": 32,
              "source": "EXPECTED_HIDDEN_WIDTH: Final = 1024"
            },
            {
              "line": 33,
              "source": "HIDDEN_STATE_COUNT: Final = 13"
            }
          ]
        },
        {
          "start_line": 482,
          "end_line": 501,
          "lines": [
            {
              "line": 482,
              "source": "def _default_loader("
            },
            {
              "line": 483,
              "source": "    repository: str,"
            },
            {
              "line": 484,
              "source": "    *,"
            },
            {
              "line": 485,
              "source": "    revision: str,"
            },
            {
              "line": 486,
              "source": "    local_files_only: bool = False,"
            },
            {
              "line": 487,
              "source": ") -> LoadedBackbone:"
            },
            {
              "line": 488,
              "source": "    module = import_module(\"muq\")"
            },
            {
              "line": 489,
              "source": "    root = module.MuQMuLan.from_pretrained("
            },
            {
              "line": 490,
              "source": "        repository,"
            },
            {
              "line": 491,
              "source": "        revision=revision,"
            },
            {
              "line": 492,
              "source": "        local_files_only=local_files_only,"
            },
            {
              "line": 493,
              "source": "    )"
            },
            {
              "line": 494,
              "source": "    inner_model = root.mulan.audio.model"
            },
            {
              "line": 495,
              "source": "    if not isinstance(inner_model, torch.nn.Module):"
            },
            {
              "line": 496,
              "source": "        raise HiddenStateContractError("
            },
            {
              "line": 497,
              "source": "            reason=\"model.mulan.audio.model must be a torch module\","
            },
            {
              "line": 498,
              "source": "        )"
            },
            {
              "line": 499,
              "source": "    return LoadedBackbone("
            },
            {
              "line": 500,
              "source": "        root=root,"
            },
            {
              "line": 501,
              "source": "        inner_model=_InnerModelAdapter(model=inner_model),"
            }
          ]
        },
        {
          "start_line": 524,
          "end_line": 527,
          "lines": [
            {
              "line": 524,
              "source": "    _ = loaded.root.eval()"
            },
            {
              "line": 525,
              "source": "    _ = loaded.root.to(device=\"cuda\", dtype=torch.float32)"
            },
            {
              "line": 526,
              "source": "    for parameter in loaded.root.parameters():"
            },
            {
              "line": 527,
              "source": "        parameter.requires_grad = False"
            }
          ]
        }
      ]
    },
    {
      "id": "raw_frame_call",
      "path": "/home/work/Projects/Raina-laya/src/raina_laya/features/audio_features/infrastructure/features.py",
      "sha256": "75f22e9164b4a10fec27fa2f3cb118656ea103c641fbf20f59370e8815f8318e",
      "excerpts": [
        {
          "start_line": 417,
          "end_line": 437,
          "lines": [
            {
              "line": 417,
              "source": "def extract_inner_model_layer_frames("
            },
            {
              "line": 418,
              "source": "    model: InnerAudioModel,"
            },
            {
              "line": 419,
              "source": "    context: AudioContext,"
            },
            {
              "line": 420,
              "source": "    *,"
            },
            {
              "line": 421,
              "source": "    window_start: float,"
            },
            {
              "line": 422,
              "source": "    expected_width: int = EXPECTED_HIDDEN_WIDTH,"
            },
            {
              "line": 423,
              "source": ") -> LayerFrames:"
            },
            {
              "line": 424,
              "source": "    \"\"\"Run one context once and retain every hidden state with its alignment.\"\"\""
            },
            {
              "line": 425,
              "source": "    with torch.autocast(device_type=context.waveform.device.type, enabled=False):"
            },
            {
              "line": 426,
              "source": "        output = model("
            },
            {
              "line": 427,
              "source": "            context.waveform.unsqueeze(0).to(dtype=torch.float32),"
            },
            {
              "line": 428,
              "source": "            output_hidden_states=True,"
            },
            {
              "line": 429,
              "source": "        )"
            },
            {
              "line": 430,
              "source": "    layers = _all_hidden_states(output.hidden_states, expected_width)"
            },
            {
              "line": 431,
              "source": "    frame_timestamps, valid_frame_mask = _frame_alignment("
            },
            {
              "line": 432,
              "source": "        layers[0].shape[1], layers[0].device, context, window_start"
            },
            {
              "line": 433,
              "source": "    )"
            },
            {
              "line": 434,
              "source": "    return LayerFrames("
            },
            {
              "line": 435,
              "source": "        layers=layers,"
            },
            {
              "line": 436,
              "source": "        frame_timestamps=frame_timestamps,"
            },
            {
              "line": 437,
              "source": "        valid_frame_mask=valid_frame_mask,"
            }
          ]
        }
      ]
    },
    {
      "id": "bin_pooling",
      "path": "/home/work/Projects/Raina-laya/src/raina_laya/features/audio_features/infrastructure/features.py",
      "sha256": "75f22e9164b4a10fec27fa2f3cb118656ea103c641fbf20f59370e8815f8318e",
      "excerpts": [
        {
          "start_line": 243,
          "end_line": 260,
          "lines": [
            {
              "line": 243,
              "source": "    pooled: list[torch.Tensor] = []"
            },
            {
              "line": 244,
              "source": "    for interval in bins:"
            },
            {
              "line": 245,
              "source": "        selected = ("
            },
            {
              "line": 246,
              "source": "            valid_frame_mask"
            },
            {
              "line": 247,
              "source": "            & (frame_timestamps >= interval.start)"
            },
            {
              "line": 248,
              "source": "            & (frame_timestamps < interval.end)"
            },
            {
              "line": 249,
              "source": "        )"
            },
            {
              "line": 250,
              "source": "        if not torch.any(selected):"
            },
            {
              "line": 251,
              "source": "            raise EmptyPoolingBinError(start=interval.start, end=interval.end)"
            },
            {
              "line": 252,
              "source": "        pooled.append("
            },
            {
              "line": 253,
              "source": "            torch.cat("
            },
            {
              "line": 254,
              "source": "                ("
            },
            {
              "line": 255,
              "source": "                    layer_10[0, selected].mean(dim=0),"
            },
            {
              "line": 256,
              "source": "                    layer_9[0, selected].mean(dim=0),"
            },
            {
              "line": 257,
              "source": "                ),"
            },
            {
              "line": 258,
              "source": "            ),"
            },
            {
              "line": 259,
              "source": "        )"
            },
            {
              "line": 260,
              "source": "    return torch.stack(pooled).to(dtype=torch.float32)"
            }
          ]
        },
        {
          "start_line": 464,
          "end_line": 479,
          "lines": [
            {
              "line": 464,
              "source": "    pooled: list[torch.Tensor] = []"
            },
            {
              "line": 465,
              "source": "    for interval in bins:"
            },
            {
              "line": 466,
              "source": "        selected = ("
            },
            {
              "line": 467,
              "source": "            frames.valid_frame_mask"
            },
            {
              "line": 468,
              "source": "            & (frames.frame_timestamps >= interval.start)"
            },
            {
              "line": 469,
              "source": "            & (frames.frame_timestamps < interval.end)"
            },
            {
              "line": 470,
              "source": "        )"
            },
            {
              "line": 471,
              "source": "        rows = selected.nonzero().squeeze(1)"
            },
            {
              "line": 472,
              "source": "        if rows.numel() == 0:"
            },
            {
              "line": 473,
              "source": "            raise EmptyPoolingBinError(start=interval.start, end=interval.end)"
            },
            {
              "line": 474,
              "source": "        pooled.append("
            },
            {
              "line": 475,
              "source": "            torch.stack("
            },
            {
              "line": 476,
              "source": "                [layer[0].index_select(0, rows).mean(dim=0) for layer in frames.layers],"
            },
            {
              "line": 477,
              "source": "            ),"
            },
            {
              "line": 478,
              "source": "        )"
            },
            {
              "line": 479,
              "source": "    return torch.stack(pooled).to(dtype=torch.float32)"
            }
          ]
        }
      ]
    },
    {
      "id": "feature_width_contract",
      "path": "/home/work/Projects/Raina-laya/src/raina_laya/features/grade_model/domain/model_inputs.py",
      "sha256": "aead5f666afe637244e2db195beb159a60fa9b1c8b05427eb04f369c7230ba56",
      "excerpts": [
        {
          "start_line": 8,
          "end_line": 10,
          "lines": [
            {
              "line": 8,
              "source": "FEATURE_WIDTH: Final = 2048"
            },
            {
              "line": 9,
              "source": "LAYER_WIDTH: Final = 1024"
            },
            {
              "line": 10,
              "source": "LAYER_COUNT: Final = 13"
            }
          ]
        }
      ]
    },
    {
      "id": "config_feature_width",
      "path": "/home/work/Projects/Raina-laya/src/raina_laya/features/grade_model/application/v4_training_types.py",
      "sha256": "27e050e94120b536e277e2d658f278985a42f0cffc2de0592ca57fb8420c1055",
      "excerpts": [
        {
          "start_line": 97,
          "end_line": 99,
          "lines": [
            {
              "line": 97,
              "source": "    embedding_layers: tuple[int, ...] | None = None"
            },
            {
              "line": 98,
              "source": "    gate_soft_target_mix: float | None = None"
            },
            {
              "line": 99,
              "source": "    gate_soft_targets_sha256: str | None = None"
            }
          ]
        },
        {
          "start_line": 105,
          "end_line": 110,
          "lines": [
            {
              "line": 105,
              "source": "    @property"
            },
            {
              "line": 106,
              "source": "    def feature_width(self) -> int:"
            },
            {
              "line": 107,
              "source": "        \"\"\"Return the head input width: the legacy L10+L9 cache or chosen layers.\"\"\""
            },
            {
              "line": 108,
              "source": "        if self.embedding_layers is None:"
            },
            {
              "line": 109,
              "source": "            return FEATURE_WIDTH"
            },
            {
              "line": 110,
              "source": "        return LAYER_WIDTH * len(self.embedding_layers)"
            }
          ]
        }
      ]
    },
    {
      "id": "judgment_tokens",
      "path": "/home/work/Projects/Raina-laya/src/raina_laya/features/grade_model/domain/model.py",
      "sha256": "ca8996df129dcffe6ebd3cf1a69d3bd20b18e69c31b633b1127a1ad5c7a777a1",
      "excerpts": [
        {
          "start_line": 115,
          "end_line": 119,
          "lines": [
            {
              "line": 115,
              "source": "        self.feature_projection: nn.Linear = nn.Linear(feature_width, model_width)"
            },
            {
              "line": 116,
              "source": "        self.projection_norm: nn.LayerNorm = nn.LayerNorm(model_width)"
            },
            {
              "line": 117,
              "source": "        self.ratio_embedding: nn.Linear = nn.Linear(1, model_width)"
            },
            {
              "line": 118,
              "source": "        self.grade_tokens = nn.Parameter(torch.empty(GRADE_COUNT, model_width))"
            },
            {
              "line": 119,
              "source": "        self.type_embedding: nn.Embedding = nn.Embedding(2, model_width)"
            }
          ]
        },
        {
          "start_line": 229,
          "end_line": 243,
          "lines": [
            {
              "line": 229,
              "source": "        grade_tokens = self.grade_tokens.unsqueeze(0).expand(batch_size, -1, -1)"
            },
            {
              "line": 230,
              "source": "        grade_tokens = grade_tokens + self.type_embedding.weight[GRADE_TYPE_INDEX]"
            },
            {
              "line": 231,
              "source": "        sequence: torch.Tensor = torch.cat((grade_tokens, music_tokens), dim=1)"
            },
            {
              "line": 232,
              "source": "        grade_mask = torch.zeros("
            },
            {
              "line": 233,
              "source": "            (batch_size, GRADE_COUNT),"
            },
            {
              "line": 234,
              "source": "            dtype=torch.bool,"
            },
            {
              "line": 235,
              "source": "            device=padding_mask.device,"
            },
            {
              "line": 236,
              "source": "        )"
            },
            {
              "line": 237,
              "source": "        key_padding_mask = torch.cat((grade_mask, padding_mask), dim=1)"
            },
            {
              "line": 238,
              "source": "        for layer in self.transformer_layers:"
            },
            {
              "line": 239,
              "source": "            sequence = layer("
            },
            {
              "line": 240,
              "source": "                sequence,"
            },
            {
              "line": 241,
              "source": "                src_key_padding_mask=key_padding_mask,"
            },
            {
              "line": 242,
              "source": "            )"
            },
            {
              "line": 243,
              "source": "        logits: torch.Tensor = self.scorer(sequence[:, :GRADE_COUNT])"
            }
          ]
        }
      ]
    },
    {
      "id": "cache_route",
      "path": "/home/work/Projects/Raina-laya/src/raina_laya/workflows/training_inputs.py",
      "sha256": "4ddbbf907907572d6fbe3360dcec78b9ad44e20761c8d0d8c07f14baee89cb14",
      "excerpts": [
        {
          "start_line": 214,
          "end_line": 228,
          "lines": [
            {
              "line": 214,
              "source": "        if self.layer_dir is not None:"
            },
            {
              "line": 215,
              "source": "            source_hashes, inventory_digest = _source_inventory("
            },
            {
              "line": 216,
              "source": "                self.cache_inventory_path,"
            },
            {
              "line": 217,
              "source": "                expected_sources,"
            },
            {
              "line": 218,
              "source": "            )"
            },
            {
              "line": 219,
              "source": "            try:"
            },
            {
              "line": 220,
              "source": "                store = self.audio_features.open_layer_stack("
            },
            {
              "line": 221,
              "source": "                    self.layer_dir,"
            },
            {
              "line": 222,
              "source": "                    self.layers,"
            },
            {
              "line": 223,
              "source": "                )"
            },
            {
              "line": 224,
              "source": "            except CacheIncompleteError as error:"
            },
            {
              "line": 225,
              "source": "                raise TrainingRunInputError("
            },
            {
              "line": 226,
              "source": "                    detail=f\"layer store is missing: {error.path}\","
            },
            {
              "line": 227,
              "source": "                ) from error"
            },
            {
              "line": 228,
              "source": "            inventory_digest = store.lineage_digest(inventory_digest)"
            }
          ]
        },
        {
          "start_line": 240,
          "end_line": 247,
          "lines": [
            {
              "line": 240,
              "source": "        else:"
            },
            {
              "line": 241,
              "source": "            source_hashes, inventory_digest = _source_inventory("
            },
            {
              "line": 242,
              "source": "                self.cache_inventory_path,"
            },
            {
              "line": 243,
              "source": "                expected_sources,"
            },
            {
              "line": 244,
              "source": "            )"
            },
            {
              "line": 245,
              "source": "            if not self.embedding_database.is_file():"
            },
            {
              "line": 246,
              "source": "                raise TrainingRunInputError(detail=\"embedding database is missing\")"
            },
            {
              "line": 247,
              "source": "            store = self.audio_features.open_sqlite_store(self.embedding_database)"
            }
          ]
        }
      ]
    },
    {
      "id": "installed_wrapper_loader",
      "path": "/home/work/Projects/Raina-laya/.venv/lib/python3.13/site-packages/muq/muq_mulan/models/audio.py",
      "sha256": "05231129cffeb5132aded81b9aabc79ee29fc01513f26879ef98b1b0fbb14b9c",
      "excerpts": [
        {
          "start_line": 240,
          "end_line": 243,
          "lines": [
            {
              "line": 240,
              "source": "    def _init_pretrained_model(self, model_name):"
            },
            {
              "line": 241,
              "source": "        if 'muq' in model_name.lower():"
            },
            {
              "line": 242,
              "source": "            from muq import MuQ"
            },
            {
              "line": 243,
              "source": "            self.model = MuQ.from_pretrained(model_name, cache_dir=self.hf_hub_cache_dir)"
            }
          ]
        },
        {
          "start_line": 258,
          "end_line": 261,
          "lines": [
            {
              "line": 258,
              "source": "    def _forward_pretrained_model(self, x):"
            },
            {
              "line": 259,
              "source": "        if 'muq' in self.model_name.lower():"
            },
            {
              "line": 260,
              "source": "            outputs = self.model(x, output_hidden_states=True)"
            },
            {
              "line": 261,
              "source": "            return outputs.hidden_states # 13 layer x [batch_size, Time steps, 1024 feature_dim]"
            }
          ]
        },
        {
          "start_line": 279,
          "end_line": 288,
          "lines": [
            {
              "line": 279,
              "source": "        layer_hidden_states = outputs[self.use_layer_idx]"
            },
            {
              "line": 280,
              "source": ""
            },
            {
              "line": 281,
              "source": "        if no_proj:"
            },
            {
              "line": 282,
              "source": "            outputs = layer_hidden_states"
            },
            {
              "line": 283,
              "source": "        else:"
            },
            {
              "line": 284,
              "source": "            outputs = self.proj(layer_hidden_states)"
            },
            {
              "line": 285,
              "source": "        outputs, layer_results = self.transformer(outputs, return_all_layers=True)"
            },
            {
              "line": 286,
              "source": ""
            },
            {
              "line": 287,
              "source": "        if return_mean:"
            },
            {
              "line": 288,
              "source": "            outputs = outputs.mean(dim = -2)"
            }
          ]
        }
      ]
    },
    {
      "id": "installed_wrapper_construction",
      "path": "/home/work/Projects/Raina-laya/.venv/lib/python3.13/site-packages/muq/muq_mulan/muq_mulan.py",
      "sha256": "594843bf29efed147f97768c60946d8e247dce183af085fc5dffcd3d03a7164e",
      "excerpts": [
        {
          "start_line": 95,
          "end_line": 104,
          "lines": [
            {
              "line": 95,
              "source": "    def create_MuLan_from_config(cls, config:MuQMuLanConfig, hf_hub_cache_dir=None) -> MuLanModel:"
            },
            {
              "line": 96,
              "source": ""
            },
            {
              "line": 97,
              "source": "        audio_transformer = AudioSpectrogramTransformerPretrained("
            },
            {
              "line": 98,
              "source": "            model_name = config.audio_model.name, "
            },
            {
              "line": 99,
              "source": "            model_dim = config.audio_model.model_dim,"
            },
            {
              "line": 100,
              "source": "            use_layer_idx = config.audio_model.use_layer_idx,"
            },
            {
              "line": 101,
              "source": "            **config.audio_transformer,"
            },
            {
              "line": 102,
              "source": "            frozen_pretrained = False,"
            },
            {
              "line": 103,
              "source": "            hf_hub_cache_dir = hf_hub_cache_dir,"
            },
            {
              "line": 104,
              "source": "        )"
            }
          ]
        }
      ]
    },
    {
      "id": "installed_original_muq",
      "path": "/home/work/Projects/Raina-laya/.venv/lib/python3.13/site-packages/muq/muq/muq.py",
      "sha256": "dbec360f5e3ef622d83f1a73085e67ddde946eb626acad768cc01c1f81374211",
      "excerpts": [
        {
          "start_line": 19,
          "end_line": 20,
          "lines": [
            {
              "line": 19,
              "source": "    encoder_dim:int = field(default=1024)"
            },
            {
              "line": 20,
              "source": "    encoder_depth:int = field(default=12)"
            }
          ]
        },
        {
          "start_line": 35,
          "end_line": 41,
          "lines": [
            {
              "line": 35,
              "source": "class MuQ(nn.Module, PyTorchModelHubMixin):"
            },
            {
              "line": 36,
              "source": "    def __init__(self, config: MuQConfig):"
            },
            {
              "line": 37,
              "source": "        super().__init__()"
            },
            {
              "line": 38,
              "source": "        if isinstance(config, dict):"
            },
            {
              "line": 39,
              "source": "            config = MuQConfig(**config)"
            },
            {
              "line": 40,
              "source": "        self.config = config"
            },
            {
              "line": 41,
              "source": "        self.model = MuQModel("
            }
          ]
        },
        {
          "start_line": 83,
          "end_line": 90,
          "lines": [
            {
              "line": 83,
              "source": "        _, hidden_states = self.model.get_predictions(x, attention_mask=attention_mask, is_features_only=True)"
            },
            {
              "line": 84,
              "source": "        last_hidden_state = hidden_states[-1]"
            },
            {
              "line": 85,
              "source": "        if not output_hidden_states:"
            },
            {
              "line": 86,
              "source": "            return BaseModelOutput(last_hidden_state=last_hidden_state)"
            },
            {
              "line": 87,
              "source": "        return BaseModelOutput("
            },
            {
              "line": 88,
              "source": "            last_hidden_state=last_hidden_state,"
            },
            {
              "line": 89,
              "source": "            hidden_states=hidden_states"
            },
            {
              "line": 90,
              "source": "        )"
            }
          ]
        }
      ]
    },
    {
      "id": "wrapper_cached_config",
      "path": "/home/work/Projects/Raina-laya/model/raina-laya-best-20261001/huggingface/hub/models--OpenMuQ--MuQ-MuLan-large/snapshots/2e01c796b71dca71b45251384c04cd7b237c9020/config.json",
      "sha256": "8fefc545ef87ecd9bcde7417dd03464370c48c321f36dcff20266a752079e468",
      "excerpts": [
        {
          "start_line": 12,
          "end_line": 16,
          "lines": [
            {
              "line": 12,
              "source": "  \"audio_model\": {"
            },
            {
              "line": 13,
              "source": "    \"name\": \"OpenMuQ/MuQ-large-msd-iter\","
            },
            {
              "line": 14,
              "source": "    \"model_dim\": 1024,"
            },
            {
              "line": 15,
              "source": "    \"use_layer_idx\": -1"
            },
            {
              "line": 16,
              "source": "  },"
            }
          ]
        }
      ]
    },
    {
      "id": "original_cached_config",
      "path": "/home/work/Projects/Raina-laya/model/raina-laya-best-20261001/huggingface/hub/models--OpenMuQ--MuQ-large-msd-iter/snapshots/0562a57814f6f8bbd9fdea0a25921a2fce1a841a/config.json",
      "sha256": "237335ee27d8fb951ce778701a12a79e06c51ae636dd786f97e45f51ce532543",
      "excerpts": [
        {
          "start_line": 5,
          "end_line": 7,
          "lines": [
            {
              "line": 5,
              "source": "  \"encoder_depth\": 12,"
            },
            {
              "line": 6,
              "source": "  \"encoder_dim\": 1024,"
            },
            {
              "line": 7,
              "source": "  \"features\": ["
            }
          ]
        }
      ]
    }
  ]
}
