Spaces:
Sleeping
Sleeping
Fix score decimal formatting to strictly 2 places
Browse files- inference.py +2 -2
inference.py
CHANGED
|
@@ -15,7 +15,7 @@ HF_TOKEN = os.getenv("HF_TOKEN")
|
|
| 15 |
|
| 16 |
BENCHMARK = "data_clean_env"
|
| 17 |
MAX_STEPS = 10
|
| 18 |
-
TEMPERATURE = 0.
|
| 19 |
|
| 20 |
SYSTEM_PROMPT = textwrap.dedent(
|
| 21 |
"""
|
|
@@ -54,7 +54,7 @@ def log_step(step: int, action: str, reward: float, done: bool, error: Optional[
|
|
| 54 |
|
| 55 |
def log_end(success: bool, steps: int, score: float, rewards: List[float]) -> None:
|
| 56 |
rewards_str = ",".join(f"{r:.2f}" for r in rewards)
|
| 57 |
-
print(f"[END] success={str(success).lower()} steps={steps} score={score:.
|
| 58 |
|
| 59 |
def get_model_action(client: OpenAI, obs_dict: dict) -> dict:
|
| 60 |
user_prompt = f"Observation:\n{json.dumps(obs_dict, indent=2)}\nWhat is your next action?"
|
|
|
|
| 15 |
|
| 16 |
BENCHMARK = "data_clean_env"
|
| 17 |
MAX_STEPS = 10
|
| 18 |
+
TEMPERATURE = 0.0
|
| 19 |
|
| 20 |
SYSTEM_PROMPT = textwrap.dedent(
|
| 21 |
"""
|
|
|
|
| 54 |
|
| 55 |
def log_end(success: bool, steps: int, score: float, rewards: List[float]) -> None:
|
| 56 |
rewards_str = ",".join(f"{r:.2f}" for r in rewards)
|
| 57 |
+
print(f"[END] success={str(success).lower()} steps={steps} score={score:.2f} rewards={rewards_str}", flush=True)
|
| 58 |
|
| 59 |
def get_model_action(client: OpenAI, obs_dict: dict) -> dict:
|
| 60 |
user_prompt = f"Observation:\n{json.dumps(obs_dict, indent=2)}\nWhat is your next action?"
|