luciferai-devil commited on
Commit
d9f4cc2
Β·
verified Β·
1 Parent(s): f60ce5a

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. server/app.py +68 -7
server/app.py CHANGED
@@ -12,14 +12,75 @@ app = create_fastapi_app(CodeDebugEnvironment, Action, Observation)
12
 
13
  # ── Additional required hackathon endpoints ────────────────────────────
14
 
15
- @app.get("/")
 
 
 
16
  def home():
17
- return {
18
- "message": "Welcome to the OpenEnv Code Debug Environment!",
19
- "version": "1.0.0",
20
- "endpoints": ["/health", "/tasks", "/reset", "/step", "/grader", "/baseline"],
21
- "docs": "https://huggingface.co/spaces/luciferai-devil/code-debug-env"
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
 
25
  @app.get("/tasks")
 
12
 
13
  # ── Additional required hackathon endpoints ────────────────────────────
14
 
15
+ from fastapi.responses import HTMLResponse
16
+
17
+ @app.get("/", response_class=HTMLResponse)
18
+ @app.get("/web", response_class=HTMLResponse)
19
  def home():
20
+ return """
21
+ <!DOCTYPE html>
22
+ <html>
23
+ <head>
24
+ <title>Code Debug Env | OpenEnv</title>
25
+ <style>
26
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');
27
+ body {
28
+ font-family: 'Inter', sans-serif;
29
+ background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
30
+ color: #f8fafc;
31
+ display: flex;
32
+ flex-direction: column;
33
+ align-items: center;
34
+ justify-content: center;
35
+ min-height: 100vh;
36
+ margin: 0;
37
+ text-align: center;
38
+ }
39
+ .container {
40
+ background: rgba(30, 41, 59, 0.7);
41
+ backdrop-filter: blur(12px);
42
+ padding: 3rem;
43
+ border-radius: 24px;
44
+ border: 1px solid rgba(255, 255, 255, 0.1);
45
+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
46
+ max-width: 600px;
47
+ }
48
+ h1 { font-size: 3rem; margin-bottom: 0.5rem; background: linear-gradient(to right, #60a5fa, #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
49
+ p { color: #94a3b8; font-size: 1.1rem; line-height: 1.6; }
50
+ .badge { background: #334155; padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; vertical-align: middle; border: 1px solid #475569; }
51
+ .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
52
+ .btn {
53
+ display: block;
54
+ padding: 1rem;
55
+ border-radius: 12px;
56
+ background: rgba(255, 255, 255, 0.05);
57
+ border: 1px solid rgba(255, 255, 255, 0.1);
58
+ color: #fff;
59
+ text-decoration: none;
60
+ transition: all 0.2s;
61
+ font-weight: 600;
62
+ }
63
+ .btn:hover { background: rgba(255, 255, 255, 0.1); border-color: #60a5fa; transform: translateY(-2px); }
64
+ footer { margin-top: 2rem; color: #64748b; font-size: 0.9rem; }
65
+ </style>
66
+ </head>
67
+ <body>
68
+ <div class="container">
69
+ <h1>Code Debug Env</h1>
70
+ <p>A production-grade <strong>OpenEnv</strong> for training frontier reasoning agents on code repair tasks. <span class="badge">v1.0.0</span></p>
71
+
72
+ <div class="grid">
73
+ <a href="/health" class="btn">πŸ“‘ Server Health</a>
74
+ <a href="/tasks" class="btn">πŸ“‹ Task Registry</a>
75
+ <a href="/baseline" class="btn">πŸ€– Run Baseline</a>
76
+ <a href="https://huggingface.co/spaces/luciferai-devil/code-debug-env" class="btn">πŸ“– Documentation</a>
77
+ </div>
78
+
79
+ <footer>Built for Meta & PyTorch Γ— Scaler Hackathon</footer>
80
+ </div>
81
+ </body>
82
+ </html>
83
+ """
84
 
85
 
86
  @app.get("/tasks")