Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- server/app.py +10 -6
- server/web/index.html +27 -1
server/app.py
CHANGED
|
@@ -13,12 +13,12 @@ over HTTP and WebSocket endpoints, compatible with EnvClient.
|
|
| 13 |
Endpoints:
|
| 14 |
- Custom UI: GET /web, GET /web/benchmark (served from server/web)
|
| 15 |
- Benchmark: GET /api/benchmark/models, POST /api/benchmark/run
|
| 16 |
-
- OpenEnv
|
| 17 |
-
- POST /openenv/reset
|
| 18 |
-
- POST /openenv/step
|
| 19 |
-
- GET /openenv/state
|
| 20 |
-
- GET /openenv/schema
|
| 21 |
-
- WS /openenv/ws
|
| 22 |
|
| 23 |
Usage:
|
| 24 |
# Development (with auto-reload):
|
|
@@ -321,6 +321,10 @@ def llm_complete(req: LLMCompleteRequest) -> dict[str, Any]:
|
|
| 321 |
return {"content": text, "model": model}
|
| 322 |
|
| 323 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 324 |
def main(host: str = "0.0.0.0", port: int = 8000):
|
| 325 |
"""
|
| 326 |
Entry point for direct execution via uv run or python -m.
|
|
|
|
| 13 |
Endpoints:
|
| 14 |
- Custom UI: GET /web, GET /web/benchmark (served from server/web)
|
| 15 |
- Benchmark: GET /api/benchmark/models, POST /api/benchmark/run
|
| 16 |
+
- OpenEnv HTTP/WS API: same app mounted at / and /openenv (explicit routes win first)
|
| 17 |
+
- POST /reset, /openenv/reset
|
| 18 |
+
- POST /step, /openenv/step
|
| 19 |
+
- GET /state, /openenv/state
|
| 20 |
+
- GET /schema, /openenv/schema
|
| 21 |
+
- WS /ws, /openenv/ws
|
| 22 |
|
| 23 |
Usage:
|
| 24 |
# Development (with auto-reload):
|
|
|
|
| 321 |
return {"content": text, "model": model}
|
| 322 |
|
| 323 |
|
| 324 |
+
# Stock OpenEnv paths (/reset, /state, /step, …) — registered after /, /web, /api/* so those win.
|
| 325 |
+
app.mount("/", openenv_app)
|
| 326 |
+
|
| 327 |
+
|
| 328 |
def main(host: str = "0.0.0.0", port: int = 8000):
|
| 329 |
"""
|
| 330 |
Entry point for direct execution via uv run or python -m.
|
server/web/index.html
CHANGED
|
@@ -56,6 +56,32 @@
|
|
| 56 |
background: rgba(15, 23, 42, 0.04);
|
| 57 |
border-radius: 999px;
|
| 58 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
</style>
|
| 60 |
</head>
|
| 61 |
|
|
@@ -392,7 +418,7 @@
|
|
| 392 |
</button>
|
| 393 |
<button
|
| 394 |
id="btn-step"
|
| 395 |
-
class="inline-flex items-center justify-center gap-2 rounded-2xl
|
| 396 |
>
|
| 397 |
<span id="step-spinner" class="hidden h-4 w-4 animate-spin rounded-full border-2 border-white/50 border-t-white"></span>
|
| 398 |
<span id="step-label">Take Step</span>
|
|
|
|
| 56 |
background: rgba(15, 23, 42, 0.04);
|
| 57 |
border-radius: 999px;
|
| 58 |
}
|
| 59 |
+
/* Dense stops + wide tile so indigo → fuchsia → sky blends without visible bands */
|
| 60 |
+
.btn-step-gradient {
|
| 61 |
+
background-color: #4f46e5;
|
| 62 |
+
background-image: linear-gradient(
|
| 63 |
+
93deg,
|
| 64 |
+
#4338ca 0%,
|
| 65 |
+
#4537c9 6%,
|
| 66 |
+
#4f46e5 14%,
|
| 67 |
+
#5b4ae8 22%,
|
| 68 |
+
#6d28d9 30%,
|
| 69 |
+
#7c3aed 38%,
|
| 70 |
+
#9333ea 44%,
|
| 71 |
+
#a855f7 50%,
|
| 72 |
+
#c026d3 56%,
|
| 73 |
+
#b84fd8 60%,
|
| 74 |
+
#9d4edd 64%,
|
| 75 |
+
#7c3aed 70%,
|
| 76 |
+
#6366f1 76%,
|
| 77 |
+
#4f7df0 82%,
|
| 78 |
+
#3b82f6 88%,
|
| 79 |
+
#0ea5e9 94%,
|
| 80 |
+
#0284c7 100%
|
| 81 |
+
);
|
| 82 |
+
background-size: 210% 100%;
|
| 83 |
+
background-position: 0% 50%;
|
| 84 |
+
}
|
| 85 |
</style>
|
| 86 |
</head>
|
| 87 |
|
|
|
|
| 418 |
</button>
|
| 419 |
<button
|
| 420 |
id="btn-step"
|
| 421 |
+
class="btn-step-gradient inline-flex items-center justify-center gap-2 rounded-2xl px-5 py-3 text-sm font-semibold text-white shadow-glow transition hover:brightness-110 disabled:opacity-60"
|
| 422 |
>
|
| 423 |
<span id="step-spinner" class="hidden h-4 w-4 animate-spin rounded-full border-2 border-white/50 border-t-white"></span>
|
| 424 |
<span id="step-label">Take Step</span>
|