Download tests/conftest.py from Upwork-AIML/Conditional_Causal_Difficulty_for_LLMs: direct link, hf CLI and curl.
- Browser
- Download file 1.58 kB
-
https://huggingface.co/Upwork-AIML/Conditional_Causal_Difficulty_for_LLMs/resolve/main/tests/conftest.py
- Command line
-
hf download hf://Upwork-AIML/Conditional_Causal_Difficulty_for_LLMs/tests/conftest.py
-
curl -L -o conftest.py https://huggingface.co/Upwork-AIML/Conditional_Causal_Difficulty_for_LLMs/resolve/main/tests/conftest.py
1.58 kB
| """Shared pytest fixtures: a tiny offline config and a synthetic dataset.""" | |
| from __future__ import annotations | |
| import os | |
| import pytest | |
| from causal_difficulty.config import Config | |
| from causal_difficulty.data.synth_jobs import generate_jobs | |
| def tiny_cfg(tmp_path) -> Config: | |
| cfg = Config({ | |
| "seed": 7, | |
| "paths": { | |
| "data_dir": str(tmp_path / "data"), | |
| "outputs_dir": str(tmp_path / "outputs"), | |
| "cache_dir": str(tmp_path / "cache"), | |
| }, | |
| "dataset": { | |
| "n_jobs": 12, | |
| "twins_per_job": 3, | |
| "categories": ["web_dev", "ml", "design", "writing", "data"], | |
| "complexity_tiers": ["easy", "medium", "hard"], | |
| }, | |
| "encoder": { | |
| "backbone": "hashing", | |
| "openai_embed": {"model": "text-embedding-3-small"}, | |
| "hf_lora": {"model": "BAAI/bge-small-en-v1.5", "lora_r": 8, | |
| "lora_alpha": 16, "lora_dropout": 0.05}, | |
| }, | |
| "model": {"hidden_dim": 64, "complexity_dim": 16, "dropout": 0.0}, | |
| "train": { | |
| "representation": {"epochs": 3, "lr": 1e-3, "batch_size": 16, "triplet_margin": 0.3}, | |
| "calibration": {"epochs": 5, "lr": 1e-3, "batch_size": 16, | |
| "lambda_inv": 0.5, "huber_delta": 0.1}, | |
| }, | |
| "eval": {"fragile_threshold": 0.1, "holdout_frac": 0.3}, | |
| }) | |
| for p in cfg["paths"].values(): | |
| os.makedirs(p, exist_ok=True) | |
| return cfg | |
| def jobs(): | |
| return generate_jobs(12, seed=7) | |