-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.py
More file actions
51 lines (44 loc) · 1.27 KB
/
Copy pathdemo.py
File metadata and controls
51 lines (44 loc) · 1.27 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
#!/usr/bin/env python3
"""Run a small CLR example against an external OpenAI-compatible server."""
from clr import run
# Configure the server and model here before running the demo.
BASE_URL = "http://10.195.144.18:8000"
MODEL = "gpt-oss-120b"
API_KEY = "EMPTY"
# A tiny inline dataset for a quick smoke test.
questions = [
"What is 12 * 12? Give the final answer.",
"If x + 3 = 10, what is x?",
]
ground_truths = ["144", "7"]
print(f"Loaded {len(questions)} demo questions")
# Run CLR.
metrics = run(
questions=questions,
ground_truths=ground_truths,
base_url=BASE_URL,
model=MODEL,
api_key=API_KEY,
workers=32,
K=32,
N=8,
num_claims=5,
sampling_params={
"temperature": 1.0,
"top_p": 1.0,
"top_k": 40,
"max_tokens": 102400,
# "chat_template_kwargs": {"reasoning_effort": "high"}, # use default setting
},
output_path="demo_results.json",
progress=True,
)
print("\n=== Final Metrics ===")
for key, value in metrics.items():
if isinstance(value, float):
if key.startswith("s1_") or key.startswith("pass@") or key.startswith("cons@"):
print(f" {key}: {value * 100:.2f}%")
else:
print(f" {key}: {value:.2f}")
else:
print(f" {key}: {value}")