Spaces:
Configuration error
Configuration error
File size: 2,135 Bytes
fc163a0 | 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 52 53 54 55 56 57 58 | import os
import json
import yaml
import requests
import subprocess
import time
def check_structure():
print("--- 1. Structure Check ---")
files = ["openenv.yaml", "inference.py", "env.py", "main.py", "Dockerfile", "requirements.txt"]
for f in files:
if os.path.exists(f):
print(f"β
Found {f}")
else:
print(f"β Missing {f} (MANDATORY)")
def check_yaml():
print("\n--- 2. Spec Validation ---")
try:
with open("openenv.yaml", "r") as f:
data = yaml.safe_load(f)
if data.get("openenv_v") and data.get("tasks"):
print("β
openenv.yaml is valid")
print(f"β
Found {len(data['tasks'])} tasks (Minimum 3 required)")
else:
print("β openenv.yaml is missing required fields")
except Exception as e:
print(f"β YAML Error: {e}")
def check_logs():
print("\n--- 3. Inference Log Check ---")
# We will simulate a quick run of inference.py and check the first/last lines
# This requires the server to be running. For this check, we'll verify the code pattern.
with open("inference.py", "r") as f:
content = f.read()
if "[START]" in content and "[STEP]" in content and "[END]" in content:
print("β
inference.py uses correct log tags")
if "OpenAI(" in content:
print("β
Found OpenAI Client usage")
else:
print("β Missing OpenAI Client usage (REQIURED)")
def check_reward_scaling():
print("\n--- 4. Reward Scaling Check ---")
with open("env.py", "r") as f:
env_content = f.read()
if "reward += 0." in env_content or "reward -= 0." in env_content:
print("β
Logic appears to use 0.0-1.0 normalized rewards")
else:
print("β οΈ Warning: Could not confirm normalized rewards automatically. Double check env.py.")
if __name__ == "__main__":
check_structure()
check_yaml()
check_logs()
check_reward_scaling()
print("\nπ Validation Simulation Complete. If all above are green, you are ready!")
|