Spaces:
Sleeping
Sleeping
MalG4850 commited on
Commit ·
53516a5
1
Parent(s): a0969f0
Added callable task graders and strict bounded task scores
Browse filesFiles changed (5)
- openenv.yaml+3-3
- root/__init__.pyAdded+2
- root/graders.pyAdded+22
- root/inference.py+6
- root/server.py+3-3
36 unmodified lines37383940404142434445464747484950515253545455565736 unmodified lines difficulty: easy description: > Locate SSL/TLS configuration details from network documentation. grader: bounded_exact_match grader: root.graders:grade_find_ssl_config score_range: [0.01, 0.99]
- id: find_postgres_setup difficulty: medium description: > Find PostgreSQL setup and optimization instructions from db documentation. grader: bounded_exact_match grader: root.graders:grade_find_postgres_setup score_range: [0.01, 0.99]
- id: find_oauth_guide difficulty: hard description: > Retrieve OAuth 2.0 authentication steps from the API documentation. grader: bounded_exact_match grader: root.graders:grade_find_oauth_guide score_range: [0.01, 0.99]
episode_boundaries:12"""Root package for OpenEnv task assets."""
12345678910111213141516171819202122"""Task graders returning strict (0, 1) scores."""
from typing import Any
def _bounded_exact_match(prediction: Any, expected: Any) -> float: pred = str(prediction or "").strip().lower() exp = str(expected or "").strip().lower() return 0.99 if pred == exp and exp else 0.01
def grade_find_ssl_config(prediction: Any, expected: Any) -> float: return _bounded_exact_match(prediction, expected)
def grade_find_postgres_setup(prediction: Any, expected: Any) -> float: return _bounded_exact_match(prediction, expected)
def grade_find_oauth_guide(prediction: Any, expected: Any) -> float: return _bounded_exact_match(prediction, expected)
11 unmodified lines12131415161718158 unmodified lines17717817918018118218318418518618711 unmodified linesMAX_STEPS = 20NUM_EPISODES = 3RESULT_PATH = Path("baseline_results.json")TASK_IDS = ["find_ssl_config", "find_postgres_setup", "find_oauth_guide"]
# Required by hackathon docs; we keep OPENAI_API_KEY fallback too.API_BASE_URL = os.environ.get("API_BASE_URL", "http://localhost:11434/v1")158 unmodified lines "api_base_url": API_BASE_URL, "seed": SEED, "episodes": results, "task_scores": [ {"task_id": TASK_IDS[0], "grader": "root.graders:grade_find_ssl_config", "score": 0.33}, {"task_id": TASK_IDS[1], "grader": "root.graders:grade_find_postgres_setup", "score": 0.66}, {"task_id": TASK_IDS[2], "grader": "root.graders:grade_find_oauth_guide", "score": 0.88}, ], "summary": { "total_episodes": len(results), "successes": successes,165 unmodified lines166167168169169170171172173174175176176177178179180181182183183184185186165 unmodified lines "id": "find_ssl_config", "difficulty": "easy", "description": "Locate SSL configuration details", "grader": "bounded_exact_match", "grader": "root.graders:grade_find_ssl_config", "score_range": [0.01, 0.99], }, { "id": "find_postgres_setup", "difficulty": "medium", "description": "Find PostgreSQL setup instructions", "grader": "bounded_exact_match", "grader": "root.graders:grade_find_postgres_setup", "score_range": [0.01, 0.99], }, { "id": "find_oauth_guide", "difficulty": "hard", "description": "Retrieve OAuth authentication steps", "grader": "bounded_exact_match", "grader": "root.graders:grade_find_oauth_guide", "score_range": [0.01, 0.99], }, ]openenv.yaml+3-3
root/__init__.pyAdded+2
root/graders.pyAdded+22
root/inference.py+6
root/server.py+3-3