feat: complete Phase 1 - vocabulary expansion & DriftProbe infrastructure
- CLI: nyx-probe scan with --summary/--delta/--full flags - DriftProbe: training safety with Gini coefficient + Angular Drift - Vocabulary: 54 terms (30 nimmerverse + 24 German philosophical) - Sentinels: ANCHOR/BRIDGE/CANARY/TARGET monitoring system Key findings: - German philosophical terms: 37.5% depth≥2 hit rate (vs 3.3% nimmerverse) - Super Cluster validated: heart cross-lang sim = 1.000 - Isolated Zone confirmed: being EN↔DE sim = 0.195 - Gini signature: Philosophy ~0.5 (diffuse), Technical ~0.8 (sparse) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
51
nyx_probing/config.py
Normal file
51
nyx_probing/config.py
Normal file
@@ -0,0 +1,51 @@
|
||||
"""
|
||||
Configuration for nyx-probing framework.
|
||||
"""
|
||||
from pathlib import Path
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
import os
|
||||
|
||||
|
||||
class ModelConfig(BaseModel):
|
||||
"""Model configuration."""
|
||||
name: str = "Qwen/Qwen2.5-7B"
|
||||
device: str = "cuda"
|
||||
dtype: str = "float16"
|
||||
cache_dir: Optional[Path] = None
|
||||
|
||||
|
||||
class ProbeConfig(BaseModel):
|
||||
"""Probe configuration."""
|
||||
max_new_tokens: int = 50
|
||||
temperature: float = 0.8
|
||||
do_sample: bool = True
|
||||
num_runs: int = 5 # For distribution sampling
|
||||
|
||||
|
||||
class StorageConfig(BaseModel):
|
||||
"""Storage configuration."""
|
||||
results_dir: Path = Path("results")
|
||||
experiments_dir: Path = Path("experiments")
|
||||
|
||||
|
||||
class Config(BaseModel):
|
||||
"""Main configuration."""
|
||||
model: ModelConfig = ModelConfig()
|
||||
probe: ProbeConfig = ProbeConfig()
|
||||
storage: StorageConfig = StorageConfig()
|
||||
|
||||
# Paths
|
||||
project_root: Path = Path(__file__).parent.parent
|
||||
|
||||
class Config:
|
||||
arbitrary_types_allowed = True
|
||||
|
||||
|
||||
# Default config instance
|
||||
config = Config()
|
||||
|
||||
|
||||
def get_config() -> Config:
|
||||
"""Get the current configuration."""
|
||||
return config
|
||||
Reference in New Issue
Block a user