Addy897 commited on
Commit
ebc798b
·
1 Parent(s): a2abcaa

easy task fix

Browse files
.gitignore CHANGED
@@ -1,2 +1,3 @@
1
  .venv
2
  .env
 
 
1
  .venv
2
  .env
3
+ __pycache__/
inference.py CHANGED
@@ -8,7 +8,8 @@ from openai import OpenAI
8
  from support_ops_env.env import SupportOpsEnv
9
  from support_ops_env.models import Action, Observation
10
  from support_ops_env.tasks import list_task_ids
11
-
 
12
  LOCAL_IMAGE_NAME = os.getenv("LOCAL_IMAGE_NAME")
13
  API_KEY = os.getenv("HF_TOKEN") or os.getenv("OPENAI_API_KEY") or os.getenv("API_KEY")
14
  API_BASE_URL = os.getenv("API_BASE_URL", "https://router.huggingface.co/v1")
@@ -102,9 +103,11 @@ def get_model_action(client: OpenAI, observation: Observation, step: int, reward
102
 
103
 
104
  def clamp_score(score: float) -> float:
105
- """Clamp score to strictly open interval (0, 1) as required by the grader."""
106
- _EPSILON = 1e-6
107
- return min(max(float(score), _EPSILON), 1.0 - _EPSILON)
 
 
108
 
109
 
110
  def select_tasks(requested: str) -> List[str]:
 
8
  from support_ops_env.env import SupportOpsEnv
9
  from support_ops_env.models import Action, Observation
10
  from support_ops_env.tasks import list_task_ids
11
+ from dotenv import load_dotenv
12
+ load_dotenv()
13
  LOCAL_IMAGE_NAME = os.getenv("LOCAL_IMAGE_NAME")
14
  API_KEY = os.getenv("HF_TOKEN") or os.getenv("OPENAI_API_KEY") or os.getenv("API_KEY")
15
  API_BASE_URL = os.getenv("API_BASE_URL", "https://router.huggingface.co/v1")
 
103
 
104
 
105
  def clamp_score(score: float) -> float:
106
+ """Clamp score to strictly open interval (0, 1).
107
+ Uses 0.001/0.999 so the value survives :.3f log formatting —
108
+ the submission parser reads that string, so 1e-6 would round
109
+ to '0.000' and be rejected as exactly 0.0."""
110
+ return min(max(float(score), 0.001), 0.999)
111
 
112
 
113
  def select_tasks(requested: str) -> List[str]:
support_ops_env/__pycache__/__init__.cpython-314.pyc ADDED
Binary file (447 Bytes). View file
 
support_ops_env/__pycache__/env.cpython-314.pyc ADDED
Binary file (18.2 kB). View file
 
support_ops_env/__pycache__/models.cpython-314.pyc ADDED
Binary file (5.46 kB). View file
 
support_ops_env/__pycache__/reward.cpython-314.pyc ADDED
Binary file (876 Bytes). View file
 
support_ops_env/__pycache__/state.cpython-314.pyc ADDED
Binary file (2.34 kB). View file
 
support_ops_env/graders/__pycache__/__init__.cpython-314.pyc ADDED
Binary file (1.17 kB). View file
 
support_ops_env/graders/__pycache__/common.cpython-314.pyc ADDED
Binary file (7.57 kB). View file
 
support_ops_env/graders/__pycache__/easy.cpython-314.pyc ADDED
Binary file (877 Bytes). View file
 
support_ops_env/graders/__pycache__/hard.cpython-314.pyc ADDED
Binary file (901 Bytes). View file
 
support_ops_env/graders/__pycache__/medium.cpython-314.pyc ADDED
Binary file (879 Bytes). View file
 
support_ops_env/graders/common.py CHANGED
@@ -7,8 +7,8 @@ from ..models import StateModel, TaskGrade, TaskSpec, TicketSpec
7
  # Scores must be strictly within (0, 1) — the submission grader rejects
8
  # exact 0.0 and 1.0. Because all non-context components are binary,
9
  # a perfect or zero run would otherwise produce exactly 0.0 or 1.0.
10
- _SCORE_MIN = 1e-6
11
- _SCORE_MAX = 1.0 - 1e-6
12
 
13
 
14
  def _clamp(score: float) -> float:
 
7
  # Scores must be strictly within (0, 1) — the submission grader rejects
8
  # exact 0.0 and 1.0. Because all non-context components are binary,
9
  # a perfect or zero run would otherwise produce exactly 0.0 or 1.0.
10
+ _SCORE_MIN = 0.001
11
+ _SCORE_MAX = 0.999
12
 
13
 
14
  def _clamp(score: float) -> float:
support_ops_env/tasks/__pycache__/__init__.cpython-314.pyc ADDED
Binary file (307 Bytes). View file
 
support_ops_env/tasks/__pycache__/loader.cpython-314.pyc ADDED
Binary file (2.61 kB). View file