Repository navigation
Expand file tree
/
Copy pathconfig.py
More file actions
61 lines (52 loc) · 1.59 KB
/
Copy pathconfig.py
File metadata and controls
61 lines (52 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"""Configuration for IFBench using pydantic-settings."""
from pydantic import Field
from pydantic_settings import BaseSettings, SettingsConfigDict
class BenchmarkSettings(BaseSettings):
"""Settings for running IFBench benchmarks."""
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
extra="ignore",
)
# API Configuration
api_base: str = Field(
default="http://localhost:8000/v1",
description="Base URL for the OpenAI-compatible API",
)
api_key: str | None = Field(
default=None,
description="API key for authentication",
)
model: str = Field(
default="",
description="Model name to use for generation",
)
# Generation Parameters
temperature: float = Field(
default=0.6,
description="Sampling temperature",
)
max_tokens: int = Field(
default=4096,
description="Maximum tokens to generate",
)
seed: int | None = Field(
default=42,
description="Random seed for reproducibility (None for random)",
)
# Benchmark Parameters
input_file: str = Field(
default="data/IFBench_test.jsonl",
description="Path to IFBench test file",
)
output_file: str = Field(
default="data/responses.jsonl",
description="Output file for responses",
)
workers: int = Field(
default=8,
description="Number of parallel workers",
)
def get_settings() -> BenchmarkSettings:
"""Load settings from environment and .env file."""
return BenchmarkSettings()