Pratyush-01 commited on
Commit
65358a3
·
verified ·
1 Parent(s): add05eb

openenv push: sync full repo

Browse files
.ruff_cache/0.15.12/16873147363735852438 ADDED
Binary file (196 Bytes). View file
 
.ruff_cache/0.15.12/2409525769882325912 ADDED
Binary file (196 Bytes). View file
 
.ruff_cache/0.15.12/3209216679696091994 ADDED
Binary file (1.32 kB). View file
 
.ruff_cache/0.15.12/9970129136408550737 ADDED
Binary file (1.32 kB). View file
 
.vscode/settings.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "python.defaultInterpreterPath": "/Users/pratyush/miniconda3/envs/openenv_run/bin/python",
3
+ "python.analysis.extraPaths": ["${workspaceFolder}"],
4
+ "python.testing.pytestEnabled": true,
5
+ "python.testing.pytestArgs": ["tests"]
6
+ }
Dockerfile CHANGED
@@ -102,5 +102,4 @@ EXPOSE 7860
102
  HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
103
  CMD curl -fsS "http://127.0.0.1:${PORT}/health" || exit 1
104
 
105
- ENV ENABLE_WEB_INTERFACE=true
106
  CMD ["python3", "-m", "uvicorn", "_space_app:app", "--host", "0.0.0.0", "--port", "7860"]
 
102
  HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
103
  CMD curl -fsS "http://127.0.0.1:${PORT}/health" || exit 1
104
 
 
105
  CMD ["python3", "-m", "uvicorn", "_space_app:app", "--host", "0.0.0.0", "--port", "7860"]
README.md CHANGED
@@ -14,7 +14,6 @@ tags:
14
  - physics
15
  - equation-discovery
16
  - ode
17
- base_path: /web
18
  ---
19
 
20
  # PhysiX — Equation Discovery via RLVR
 
14
  - physics
15
  - equation-discovery
16
  - ode
 
17
  ---
18
 
19
  # PhysiX — Equation Discovery via RLVR
train/physix_train_colab.ipynb CHANGED
@@ -35,12 +35,12 @@
35
  },
36
  {
37
  "cell_type": "code",
 
38
  "metadata": {},
 
39
  "source": [
40
  "!nvidia-smi"
41
- ],
42
- "execution_count": null,
43
- "outputs": []
44
  },
45
  {
46
  "cell_type": "markdown",
@@ -56,7 +56,9 @@
56
  },
57
  {
58
  "cell_type": "code",
 
59
  "metadata": {},
 
60
  "source": [
61
  "import os\n",
62
  "from pathlib import Path\n",
@@ -102,9 +104,7 @@
102
  " Path(d).mkdir(parents=True, exist_ok=True)\n",
103
  "\n",
104
  "print(\"caches under /tmp ready\")"
105
- ],
106
- "execution_count": null,
107
- "outputs": []
108
  },
109
  {
110
  "cell_type": "markdown",
@@ -123,7 +123,9 @@
123
  },
124
  {
125
  "cell_type": "code",
 
126
  "metadata": {},
 
127
  "source": [
128
  "import os\n",
129
  "from getpass import getpass\n",
@@ -209,9 +211,7 @@
209
  " print(\"WANDB_API_KEY: ready\")\n",
210
  "else:\n",
211
  " print(\"WANDB_API_KEY: NOT set (W&B logging will be disabled)\")"
212
- ],
213
- "execution_count": null,
214
- "outputs": []
215
  },
216
  {
217
  "cell_type": "markdown",
@@ -230,7 +230,9 @@
230
  },
231
  {
232
  "cell_type": "code",
 
233
  "metadata": {},
 
234
  "source": [
235
  "%%capture\n",
236
  "!pip install -q --upgrade pip\n",
@@ -252,9 +254,7 @@
252
  " \"openenv-core[core]>=0.2.2\" \\\n",
253
  " \"huggingface_hub>=0.24,<1.0\" \\\n",
254
  " \"matplotlib>=3.7,<4.0\""
255
- ],
256
- "execution_count": null,
257
- "outputs": []
258
  },
259
  {
260
  "cell_type": "markdown",
@@ -271,7 +271,9 @@
271
  },
272
  {
273
  "cell_type": "code",
 
274
  "metadata": {},
 
275
  "source": [
276
  "from pathlib import Path\n",
277
  "import shutil\n",
@@ -296,13 +298,13 @@
296
  "assert (PHYSIX_LOCAL / \"physix\" / \"__init__.py\").is_file(), f\"missing physix/ package in {PHYSIX_LOCAL}\"\n",
297
  "print(\"physix-live source at\", PHYSIX_LOCAL)\n",
298
  "!ls {PHYSIX_LOCAL}"
299
- ],
300
- "execution_count": null,
301
- "outputs": []
302
  },
303
  {
304
  "cell_type": "code",
 
305
  "metadata": {},
 
306
  "source": [
307
  "import subprocess, sys\n",
308
  "result = subprocess.run(\n",
@@ -319,13 +321,13 @@
319
  " \"--upgrade pip` and retry); (3) a hatchling build backend hiccup — \"\n",
320
  " \"rerun this cell.\")\n",
321
  "print(result.stdout.splitlines()[-1] if result.stdout else \"install ok\")"
322
- ],
323
- "execution_count": null,
324
- "outputs": []
325
  },
326
  {
327
  "cell_type": "code",
 
328
  "metadata": {},
 
329
  "source": [
330
  "import unsloth # MUST come before trl / transformers so its monkey-patches land first\n",
331
  "import torch, trl, transformers, datasets, wandb\n",
@@ -336,9 +338,7 @@
336
  "print(f\"unsloth={unsloth.__version__} trl={trl.__version__} transformers={transformers.__version__} datasets={datasets.__version__}\")\n",
337
  "print(f\"physix loaded from {physix.__file__}\")\n",
338
  "assert trl.__version__ == \"0.24.0\", f\"trl must be pinned to 0.24.0, got {trl.__version__}\""
339
- ],
340
- "execution_count": null,
341
- "outputs": []
342
  },
343
  {
344
  "cell_type": "markdown",
@@ -361,7 +361,9 @@
361
  },
362
  {
363
  "cell_type": "code",
 
364
  "metadata": {},
 
365
  "source": [
366
  "PROFILES: dict[str, dict] = {\n",
367
  " \"1.5b\": {\n",
@@ -425,9 +427,7 @@
425
  "print(f\"Profile: {ACTIVE_PROFILE} base={p['base_model']}\")\n",
426
  "print(f\"System: {SYSTEM_ID or 'all 6 in-distribution systems'}\")\n",
427
  "print(f\"Push to Hub: {PUSH_TO_HUB}\")"
428
- ],
429
- "execution_count": null,
430
- "outputs": []
431
  },
432
  {
433
  "cell_type": "markdown",
@@ -442,7 +442,9 @@
442
  },
443
  {
444
  "cell_type": "code",
 
445
  "metadata": {},
 
446
  "source": [
447
  "import subprocess, sys\n",
448
  "\n",
@@ -466,9 +468,7 @@
466
  "\n",
467
  "print(\"$\", \" \".join(sft_cmd))\n",
468
  "subprocess.run(sft_cmd, check=True)"
469
- ],
470
- "execution_count": null,
471
- "outputs": []
472
  },
473
  {
474
  "cell_type": "markdown",
@@ -491,7 +491,9 @@
491
  },
492
  {
493
  "cell_type": "code",
 
494
  "metadata": {},
 
495
  "source": [
496
  "GRPO_OUT = \"/tmp/physix-grpo\"\n",
497
  "\n",
@@ -522,9 +524,7 @@
522
  "\n",
523
  "print(\"$\", \" \".join(grpo_cmd))\n",
524
  "subprocess.run(grpo_cmd, check=True)"
525
- ],
526
- "execution_count": null,
527
- "outputs": []
528
  },
529
  {
530
  "cell_type": "markdown",
@@ -537,7 +537,9 @@
537
  },
538
  {
539
  "cell_type": "code",
 
540
  "metadata": {},
 
541
  "source": [
542
  "import json, glob\n",
543
  "from pathlib import Path\n",
@@ -572,13 +574,13 @@
572
  "axes[1].set_xlabel(\"step\"); axes[1].set_ylabel(\"reward\"); axes[1].grid(alpha=0.3)\n",
573
  "\n",
574
  "plt.tight_layout(); plt.savefig(\"/tmp/colab_loss_reward.png\", dpi=120); plt.show()"
575
- ],
576
- "execution_count": null,
577
- "outputs": []
578
  },
579
  {
580
  "cell_type": "code",
 
581
  "metadata": {},
 
582
  "source": [
583
  "components = [\n",
584
  " (\"rewards/reward_match/mean\", \"match (R²)\"),\n",
@@ -595,9 +597,7 @@
595
  "plt.title(\"Per-component reward\")\n",
596
  "plt.xlabel(\"step\"); plt.ylabel(\"mean reward\"); plt.grid(alpha=0.3); plt.legend()\n",
597
  "plt.tight_layout(); plt.savefig(\"/tmp/colab_reward_components.png\", dpi=120); plt.show()"
598
- ],
599
- "execution_count": null,
600
- "outputs": []
601
  },
602
  {
603
  "cell_type": "markdown",
@@ -610,7 +610,9 @@
610
  },
611
  {
612
  "cell_type": "code",
 
613
  "metadata": {},
 
614
  "source": [
615
  "import json\n",
616
  "from physix.server.environment import PhysiXEnvironment\n",
@@ -651,9 +653,7 @@
651
  " print(\"\\n=== Reward breakdown ===\\n\", step_obs.reward_breakdown)\n",
652
  "except Exception as exc:\n",
653
  " print(\"Failed to parse / step:\", exc)"
654
- ],
655
- "execution_count": null,
656
- "outputs": []
657
  },
658
  {
659
  "cell_type": "markdown",
@@ -688,4 +688,4 @@
688
  },
689
  "nbformat": 4,
690
  "nbformat_minor": 0
691
- }
 
35
  },
36
  {
37
  "cell_type": "code",
38
+ "execution_count": null,
39
  "metadata": {},
40
+ "outputs": [],
41
  "source": [
42
  "!nvidia-smi"
43
+ ]
 
 
44
  },
45
  {
46
  "cell_type": "markdown",
 
56
  },
57
  {
58
  "cell_type": "code",
59
+ "execution_count": null,
60
  "metadata": {},
61
+ "outputs": [],
62
  "source": [
63
  "import os\n",
64
  "from pathlib import Path\n",
 
104
  " Path(d).mkdir(parents=True, exist_ok=True)\n",
105
  "\n",
106
  "print(\"caches under /tmp ready\")"
107
+ ]
 
 
108
  },
109
  {
110
  "cell_type": "markdown",
 
123
  },
124
  {
125
  "cell_type": "code",
126
+ "execution_count": null,
127
  "metadata": {},
128
+ "outputs": [],
129
  "source": [
130
  "import os\n",
131
  "from getpass import getpass\n",
 
211
  " print(\"WANDB_API_KEY: ready\")\n",
212
  "else:\n",
213
  " print(\"WANDB_API_KEY: NOT set (W&B logging will be disabled)\")"
214
+ ]
 
 
215
  },
216
  {
217
  "cell_type": "markdown",
 
230
  },
231
  {
232
  "cell_type": "code",
233
+ "execution_count": null,
234
  "metadata": {},
235
+ "outputs": [],
236
  "source": [
237
  "%%capture\n",
238
  "!pip install -q --upgrade pip\n",
 
254
  " \"openenv-core[core]>=0.2.2\" \\\n",
255
  " \"huggingface_hub>=0.24,<1.0\" \\\n",
256
  " \"matplotlib>=3.7,<4.0\""
257
+ ]
 
 
258
  },
259
  {
260
  "cell_type": "markdown",
 
271
  },
272
  {
273
  "cell_type": "code",
274
+ "execution_count": null,
275
  "metadata": {},
276
+ "outputs": [],
277
  "source": [
278
  "from pathlib import Path\n",
279
  "import shutil\n",
 
298
  "assert (PHYSIX_LOCAL / \"physix\" / \"__init__.py\").is_file(), f\"missing physix/ package in {PHYSIX_LOCAL}\"\n",
299
  "print(\"physix-live source at\", PHYSIX_LOCAL)\n",
300
  "!ls {PHYSIX_LOCAL}"
301
+ ]
 
 
302
  },
303
  {
304
  "cell_type": "code",
305
+ "execution_count": null,
306
  "metadata": {},
307
+ "outputs": [],
308
  "source": [
309
  "import subprocess, sys\n",
310
  "result = subprocess.run(\n",
 
321
  " \"--upgrade pip` and retry); (3) a hatchling build backend hiccup — \"\n",
322
  " \"rerun this cell.\")\n",
323
  "print(result.stdout.splitlines()[-1] if result.stdout else \"install ok\")"
324
+ ]
 
 
325
  },
326
  {
327
  "cell_type": "code",
328
+ "execution_count": null,
329
  "metadata": {},
330
+ "outputs": [],
331
  "source": [
332
  "import unsloth # MUST come before trl / transformers so its monkey-patches land first\n",
333
  "import torch, trl, transformers, datasets, wandb\n",
 
338
  "print(f\"unsloth={unsloth.__version__} trl={trl.__version__} transformers={transformers.__version__} datasets={datasets.__version__}\")\n",
339
  "print(f\"physix loaded from {physix.__file__}\")\n",
340
  "assert trl.__version__ == \"0.24.0\", f\"trl must be pinned to 0.24.0, got {trl.__version__}\""
341
+ ]
 
 
342
  },
343
  {
344
  "cell_type": "markdown",
 
361
  },
362
  {
363
  "cell_type": "code",
364
+ "execution_count": null,
365
  "metadata": {},
366
+ "outputs": [],
367
  "source": [
368
  "PROFILES: dict[str, dict] = {\n",
369
  " \"1.5b\": {\n",
 
427
  "print(f\"Profile: {ACTIVE_PROFILE} base={p['base_model']}\")\n",
428
  "print(f\"System: {SYSTEM_ID or 'all 6 in-distribution systems'}\")\n",
429
  "print(f\"Push to Hub: {PUSH_TO_HUB}\")"
430
+ ]
 
 
431
  },
432
  {
433
  "cell_type": "markdown",
 
442
  },
443
  {
444
  "cell_type": "code",
445
+ "execution_count": null,
446
  "metadata": {},
447
+ "outputs": [],
448
  "source": [
449
  "import subprocess, sys\n",
450
  "\n",
 
468
  "\n",
469
  "print(\"$\", \" \".join(sft_cmd))\n",
470
  "subprocess.run(sft_cmd, check=True)"
471
+ ]
 
 
472
  },
473
  {
474
  "cell_type": "markdown",
 
491
  },
492
  {
493
  "cell_type": "code",
494
+ "execution_count": null,
495
  "metadata": {},
496
+ "outputs": [],
497
  "source": [
498
  "GRPO_OUT = \"/tmp/physix-grpo\"\n",
499
  "\n",
 
524
  "\n",
525
  "print(\"$\", \" \".join(grpo_cmd))\n",
526
  "subprocess.run(grpo_cmd, check=True)"
527
+ ]
 
 
528
  },
529
  {
530
  "cell_type": "markdown",
 
537
  },
538
  {
539
  "cell_type": "code",
540
+ "execution_count": null,
541
  "metadata": {},
542
+ "outputs": [],
543
  "source": [
544
  "import json, glob\n",
545
  "from pathlib import Path\n",
 
574
  "axes[1].set_xlabel(\"step\"); axes[1].set_ylabel(\"reward\"); axes[1].grid(alpha=0.3)\n",
575
  "\n",
576
  "plt.tight_layout(); plt.savefig(\"/tmp/colab_loss_reward.png\", dpi=120); plt.show()"
577
+ ]
 
 
578
  },
579
  {
580
  "cell_type": "code",
581
+ "execution_count": null,
582
  "metadata": {},
583
+ "outputs": [],
584
  "source": [
585
  "components = [\n",
586
  " (\"rewards/reward_match/mean\", \"match (R²)\"),\n",
 
597
  "plt.title(\"Per-component reward\")\n",
598
  "plt.xlabel(\"step\"); plt.ylabel(\"mean reward\"); plt.grid(alpha=0.3); plt.legend()\n",
599
  "plt.tight_layout(); plt.savefig(\"/tmp/colab_reward_components.png\", dpi=120); plt.show()"
600
+ ]
 
 
601
  },
602
  {
603
  "cell_type": "markdown",
 
610
  },
611
  {
612
  "cell_type": "code",
613
+ "execution_count": null,
614
  "metadata": {},
615
+ "outputs": [],
616
  "source": [
617
  "import json\n",
618
  "from physix.server.environment import PhysiXEnvironment\n",
 
653
  " print(\"\\n=== Reward breakdown ===\\n\", step_obs.reward_breakdown)\n",
654
  "except Exception as exc:\n",
655
  " print(\"Failed to parse / step:\", exc)"
656
+ ]
 
 
657
  },
658
  {
659
  "cell_type": "markdown",
 
688
  },
689
  "nbformat": 4,
690
  "nbformat_minor": 0
691
+ }