Spaces:
Sleeping
Sleeping
| #!/usr/bin/env python | |
| """ | |
| Generate sample inference output for testing. | |
| Use this to test validation without running full inference. | |
| """ | |
| import sys | |
| import time | |
| def main(): | |
| """Generate sample logs""" | |
| print("[START] task=intersection-management env=autonomous-traffic-control model=Qwen/Qwen2.5-72B-Instruct") | |
| rewards = [] | |
| for step in range(1, 9): | |
| import random | |
| reward = round(random.uniform(0.4, 0.9), 2) | |
| rewards.append(reward) | |
| done = "true" if step == 8 else "false" | |
| action = f"GREEN_NS(duration={10+step}s)" | |
| print(f"[STEP] step={step} action={action} reward={reward:.2f} done={done} error=null") | |
| time.sleep(0.1) | |
| score = round(sum(rewards) / len(rewards), 3) | |
| success = "true" if score >= 0.5 else "false" | |
| rewards_str = ",".join(f"{r:.2f}" for r in rewards) | |
| print(f"[END] success={success} steps={len(rewards)} score={score:.3f} rewards={rewards_str}") | |
| if __name__ == "__main__": | |
| main() | |