kgdrathan commited on
Commit
60b22ff
·
verified ·
1 Parent(s): 1eaaf1d

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +0 -7
  2. server/app.py +20 -1
README.md CHANGED
@@ -13,12 +13,6 @@ tags:
13
  - RL
14
  ---
15
 
16
- <p align="center">
17
- <a href="https://kgdrathan-explainer-env-dashboard.hf.space/">
18
- <strong>Open the live dashboard</strong>
19
- </a>
20
- </p>
21
-
22
  <p align="center">
23
  <a href="https://kgdrathan-explainer-env-dashboard.hf.space/">
24
  https://kgdrathan-explainer-env-dashboard.hf.space/
@@ -185,6 +179,5 @@ The SFT adapter is here:
185
  ## Links
186
 
187
  - Environment Space: [kgdrathan-explainer-env](https://kgdrathan-explainer-env.hf.space)
188
- - Dashboard Space: [kgdrathan-explainer-env-dashboard](https://kgdrathan-explainer-env-dashboard.hf.space/)
189
  - SFT adapter: [kgdrathan/ministral-3-3b-4bit-marimo-manim](https://huggingface.co/kgdrathan/ministral-3-3b-4bit-marimo-manim/)
190
  - Reward details: [explainer_env/rewards/README.md](explainer_env/rewards/README.md)
 
13
  - RL
14
  ---
15
 
 
 
 
 
 
 
16
  <p align="center">
17
  <a href="https://kgdrathan-explainer-env-dashboard.hf.space/">
18
  https://kgdrathan-explainer-env-dashboard.hf.space/
 
179
  ## Links
180
 
181
  - Environment Space: [kgdrathan-explainer-env](https://kgdrathan-explainer-env.hf.space)
 
182
  - SFT adapter: [kgdrathan/ministral-3-3b-4bit-marimo-manim](https://huggingface.co/kgdrathan/ministral-3-3b-4bit-marimo-manim/)
183
  - Reward details: [explainer_env/rewards/README.md](explainer_env/rewards/README.md)
server/app.py CHANGED
@@ -28,7 +28,10 @@ Usage:
28
  python -m server.app
29
  """
30
 
 
 
31
  from contextlib import asynccontextmanager
 
32
 
33
  try:
34
  from openenv.core.env_server.http_server import create_app
@@ -45,13 +48,29 @@ except ImportError:
45
  from server.explainer_env_environment import ExplainerEnvironment
46
 
47
 
48
- # Create the app with web interface and README integration
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  app = create_app(
50
  ExplainerEnvironment,
51
  ExplainerAction,
52
  ExplainerObservation,
53
  env_name="explainer_env",
54
  max_concurrent_envs=4, # parallel training rollouts
 
55
  )
56
 
57
 
 
28
  python -m server.app
29
  """
30
 
31
+ import os
32
+ import sys
33
  from contextlib import asynccontextmanager
34
+ from pathlib import Path
35
 
36
  try:
37
  from openenv.core.env_server.http_server import create_app
 
48
  from server.explainer_env_environment import ExplainerEnvironment
49
 
50
 
51
+ def _build_dashboard_tab(*_args, **_kwargs):
52
+ """Return the project dashboard as an OpenEnv custom web-interface tab."""
53
+ project_root = Path(__file__).resolve().parents[2]
54
+ if str(project_root) not in sys.path:
55
+ sys.path.insert(0, str(project_root))
56
+
57
+ from dashboard import build_ui
58
+
59
+ return build_ui()
60
+
61
+
62
+ # Serve the dashboard from the same FastAPI service by default. OpenEnv only
63
+ # attaches gradio_builder when its web interface is enabled.
64
+ os.environ.setdefault("ENABLE_WEB_INTERFACE", "true")
65
+
66
+ # Create the app with web interface, README integration, and the dashboard tab.
67
  app = create_app(
68
  ExplainerEnvironment,
69
  ExplainerAction,
70
  ExplainerObservation,
71
  env_name="explainer_env",
72
  max_concurrent_envs=4, # parallel training rollouts
73
+ gradio_builder=_build_dashboard_tab,
74
  )
75
 
76