| from __future__ import annotations | |
| from dataclasses import dataclass | |
| class IndexConfig: | |
| dim: int | |
| m: int = 32 | |
| ef_construction: int = 200 | |
| ef_search: int = 128 | |
| metric: str = "cosine" # "cosine" or "l2" | |
| class EmbedConfig: | |
| model_name: str | |
| pooling: str = "cls" # "cls" or "mean" | |
| max_length: int = 256 | |
| batch_size: int = 64 | |
| normalize: bool = True | |
| class ProjectorConfig: | |
| input_dim: int = 768 | |
| llm_dim: int = 4096 | |
| # --- Spectra-Reason-GCD (implementation2.md) --- | |
| class PerceiverResamplerConfig: | |
| d_model: int = 1024 | |
| llm_dim: int = 4096 | |
| num_latents: int = 64 | |
| num_heads: int = 8 | |
| num_layers: int = 2 | |
| dropout: float = 0.1 | |
| class SpectraReasonGCDConfig: | |
| """Config for Spectra-Reason-GCD pipeline.""" | |
| llm_name: str = "meta-llama/Meta-Llama-3-8B-Instruct" | |
| llm_dim: int = 4096 | |
| num_soft_tokens: int = 64 | |
| max_peaks: int = 60 | |
| perceiver: PerceiverResamplerConfig = PerceiverResamplerConfig() | |