summaryrefslogtreecommitdiff
path: root/src/personalization/config
diff options
context:
space:
mode:
authorYurenHao0426 <blackhao0426@gmail.com>2026-02-10 20:16:36 +0000
committerYurenHao0426 <blackhao0426@gmail.com>2026-02-10 20:16:36 +0000
commit5626080ca4c4219aec4888d6b9406d0d3349fb55 (patch)
tree86287d9fd5833e11ccd78566992540f2664fd195 /src/personalization/config
parenta2036838807428424bbbaff507a6563749a83145 (diff)
Add RAG rewrite, 60-session experiment scripts, and analysis tools
- RAG rewrite adapter and vector preference pipeline in personalized_llm - 60-session experiment queue scripts (reflection, rag, rag_vector, rag_rewrite) - Vector-preference correlation analysis and visualization scripts - Local reward model batch processing improvements - Updated CLAUDE.md with full experiment documentation and notes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/personalization/config')
-rw-r--r--src/personalization/config/registry.py5
-rw-r--r--src/personalization/config/settings.py4
2 files changed, 7 insertions, 2 deletions
diff --git a/src/personalization/config/registry.py b/src/personalization/config/registry.py
index 6048044..c7a6a09 100644
--- a/src/personalization/config/registry.py
+++ b/src/personalization/config/registry.py
@@ -7,6 +7,9 @@ import yaml
from personalization.config import settings
+# Project root for resolving config paths
+_PROJECT_ROOT = Path(__file__).parent.parent.parent.parent
+
# Avoid circular imports by NOT importing extractors here at top level
# from personalization.models.preference_extractor.base import PreferenceExtractorBase
# from personalization.models.preference_extractor.rule_extractor import QwenRuleExtractor
@@ -54,7 +57,7 @@ def get_chat_model(name: str, device_override: Optional[str] = None):
cfg = settings.load_local_models_config()
# Try to load raw config to support multi-backend map
- with open("configs/local_models.yaml", "r") as f:
+ with open(_PROJECT_ROOT / "configs/local_models.yaml", "r") as f:
raw_cfg = yaml.safe_load(f)
models = raw_cfg.get("models", {}).get("llm", {})
diff --git a/src/personalization/config/settings.py b/src/personalization/config/settings.py
index 1bb1bbe..8f0cc8a 100644
--- a/src/personalization/config/settings.py
+++ b/src/personalization/config/settings.py
@@ -37,7 +37,9 @@ def _resolve_config_path(env_key: str, default_rel: str) -> Path:
value = os.getenv(env_key)
if value:
return Path(value).expanduser().resolve()
- return (Path.cwd() / default_rel).resolve()
+ # Use project root (parent of src/personalization/config) instead of cwd
+ project_root = Path(__file__).parent.parent.parent.parent
+ return (project_root / default_rel).resolve()
def load_local_models_config(path: Optional[str] = None) -> LocalModelsConfig: