modelbuilderhq commited on
Commit
f7b3b7a
·
verified ·
1 Parent(s): d815df7

Upload folder using huggingface_hub

Browse files
Dockerfile CHANGED
@@ -65,6 +65,10 @@ COPY --from=builder /app/env/.venv /app/.venv
65
  # Copy the environment code
66
  COPY --from=builder /app/env /app/env
67
 
 
 
 
 
68
  # Set PATH to use the virtual environment
69
  ENV PATH="/app/.venv/bin:$PATH"
70
 
 
65
  # Copy the environment code
66
  COPY --from=builder /app/env /app/env
67
 
68
+ # OpenEnv's Gradio sidebar reads README from /app/README.md before ENV_README_PATH.
69
+ # The repo lives under /app/env; copy so the web UI always finds the full README.
70
+ COPY --from=builder /app/env/README.md /app/README.md
71
+
72
  # Set PATH to use the virtual environment
73
  ENV PATH="/app/.venv/bin:$PATH"
74
 
openenv_ghostexec.egg-info/SOURCES.txt CHANGED
@@ -3,8 +3,10 @@ __init__.py
3
  client.py
4
  conftest.py
5
  graders.py
 
6
  models.py
7
  pyproject.toml
 
8
  ./__init__.py
9
  ./client.py
10
  ./conftest.py
 
3
  client.py
4
  conftest.py
5
  graders.py
6
+ inference.py
7
  models.py
8
  pyproject.toml
9
+ ./README.md
10
  ./__init__.py
11
  ./client.py
12
  ./conftest.py
output/baseline_comparison.png ADDED
output/loss_curve.png ADDED
output/reward_curve.png ADDED
pyproject.toml CHANGED
@@ -60,7 +60,7 @@ packages = ["ghostexec", "ghostexec.server"]
60
  package-dir = { "ghostexec" = ".", "ghostexec.server" = "server" }
61
 
62
  [tool.setuptools.package-data]
63
- ghostexec = ["scenarios/*.json"]
64
 
65
  [tool.pytest.ini_options]
66
  testpaths = ["tests"]
 
60
  package-dir = { "ghostexec" = ".", "ghostexec.server" = "server" }
61
 
62
  [tool.setuptools.package-data]
63
+ ghostexec = ["scenarios/*.json", "README.md"]
64
 
65
  [tool.pytest.ini_options]
66
  testpaths = ["tests"]
server/app.py CHANGED
@@ -58,22 +58,36 @@ from openenv.core.env_server.http_server import create_app # noqa: E402
58
 
59
 
60
  def _configure_openenv_readme_path() -> None:
61
- """OpenEnv Gradio sidebar loads README from /app/README.md or ENV_README_PATH only.
62
 
63
- Our Docker layout copies the repo to /app/env/, so README.md lives at
64
- /app/env/README.md. Set ENV_README_PATH before create_app so the Playground
65
- shows the README instead of "No README available."
 
66
  """
67
- if os.environ.get("ENV_README_PATH"):
68
- return
 
 
 
 
 
 
 
 
69
  _here = Path(__file__).resolve()
70
  for candidate in (
71
- Path("/app/env/README.md"), # HF Space / openenv Docker layout
72
- _here.parent.parent / "README.md", # repo root when running from source
 
 
73
  ):
74
- if candidate.is_file():
75
- os.environ["ENV_README_PATH"] = str(candidate)
76
- return
 
 
 
77
 
78
 
79
  _configure_openenv_readme_path()
 
58
 
59
 
60
  def _configure_openenv_readme_path() -> None:
61
+ """Ensure OpenEnv's web UI can resolve README (Gradio accordion).
62
 
63
+ OpenEnv tries /app/README.md first, then ENV_README_PATH. The Dockerfile
64
+ copies README to /app/README.md; this also sets ENV_README_PATH when a
65
+ preset points at a missing file (common on some hosts) so the loader does
66
+ not skip valid fallbacks.
67
  """
68
+ cur = os.environ.get("ENV_README_PATH")
69
+ if cur:
70
+ try:
71
+ p = Path(cur)
72
+ if p.is_file() and p.stat().st_size > 0:
73
+ return
74
+ except OSError:
75
+ pass
76
+ os.environ.pop("ENV_README_PATH", None)
77
+
78
  _here = Path(__file__).resolve()
79
  for candidate in (
80
+ Path("/app/env/README.md"),
81
+ Path("/app/README.md"),
82
+ _here.parent.parent / "README.md",
83
+ Path.cwd() / "README.md",
84
  ):
85
+ try:
86
+ if candidate.is_file() and candidate.stat().st_size > 0:
87
+ os.environ["ENV_README_PATH"] = str(candidate)
88
+ return
89
+ except OSError:
90
+ continue
91
 
92
 
93
  _configure_openenv_readme_path()