Spaces:
Sleeping
Sleeping
deploy via scripts/deploy_to_space.py
Browse files- qubit_medic/__pycache__/__init__.cpython-312.pyc +0 -0
- qubit_medic/__pycache__/config.cpython-312.pyc +0 -0
- qubit_medic/client/__pycache__/__init__.cpython-312.pyc +0 -0
- qubit_medic/client/__pycache__/client.cpython-312.pyc +0 -0
- qubit_medic/config.py +21 -0
- qubit_medic/server/__pycache__/app.cpython-312.pyc +0 -0
- qubit_medic/server/__pycache__/openenv_adapter.cpython-312.pyc +0 -0
- qubit_medic/server/__pycache__/rewards.cpython-312.pyc +0 -0
- qubit_medic/server/app.py +3 -43
qubit_medic/__pycache__/__init__.cpython-312.pyc
CHANGED
|
Binary files a/qubit_medic/__pycache__/__init__.cpython-312.pyc and b/qubit_medic/__pycache__/__init__.cpython-312.pyc differ
|
|
|
qubit_medic/__pycache__/config.cpython-312.pyc
CHANGED
|
Binary files a/qubit_medic/__pycache__/config.cpython-312.pyc and b/qubit_medic/__pycache__/config.cpython-312.pyc differ
|
|
|
qubit_medic/client/__pycache__/__init__.cpython-312.pyc
CHANGED
|
Binary files a/qubit_medic/client/__pycache__/__init__.cpython-312.pyc and b/qubit_medic/client/__pycache__/__init__.cpython-312.pyc differ
|
|
|
qubit_medic/client/__pycache__/client.cpython-312.pyc
CHANGED
|
Binary files a/qubit_medic/client/__pycache__/client.cpython-312.pyc and b/qubit_medic/client/__pycache__/client.cpython-312.pyc differ
|
|
|
qubit_medic/config.py
CHANGED
|
@@ -136,6 +136,27 @@ CURRICULUM: tuple[CurriculumLevel, ...] = (
|
|
| 136 |
promotion_threshold=0.30, # stretch goal - even partial counts
|
| 137 |
eval_size=200,
|
| 138 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
)
|
| 140 |
|
| 141 |
|
|
|
|
| 136 |
promotion_threshold=0.30, # stretch goal - even partial counts
|
| 137 |
eval_size=200,
|
| 138 |
),
|
| 139 |
+
# 2026-04 evaluation-only stress level. Same geometry as L3 but 5x the
|
| 140 |
+
# noise rate so:
|
| 141 |
+
# * zeros policy drops to ~50-60% LCR
|
| 142 |
+
# * pymatching drops to ~80-90% LCR
|
| 143 |
+
# leaving real headroom for trained-model differentiation. NOT used
|
| 144 |
+
# during training (curriculum scheduler ignores it because it isn't
|
| 145 |
+
# in the SFT/GRPO mixes); only invoked via --level L4_stress on
|
| 146 |
+
# scripts/eval.py and scripts/eval_remote.py.
|
| 147 |
+
#
|
| 148 |
+
# NOTE: the deployed HF Space (the canonical remote /reset target)
|
| 149 |
+
# was built before this level existed. Remote eval against the Space
|
| 150 |
+
# for this level will fail until the Space container is rebuilt; run
|
| 151 |
+
# locally via `python -m scripts.eval --level L4_stress ...` instead.
|
| 152 |
+
CurriculumLevel(
|
| 153 |
+
name="L4_stress",
|
| 154 |
+
distance=DISTANCE_STRETCH,
|
| 155 |
+
rounds=DISTANCE_STRETCH,
|
| 156 |
+
p=0.005,
|
| 157 |
+
promotion_threshold=0.20, # eval-only; promotion never triggered
|
| 158 |
+
eval_size=200,
|
| 159 |
+
),
|
| 160 |
)
|
| 161 |
|
| 162 |
|
qubit_medic/server/__pycache__/app.cpython-312.pyc
CHANGED
|
Binary files a/qubit_medic/server/__pycache__/app.cpython-312.pyc and b/qubit_medic/server/__pycache__/app.cpython-312.pyc differ
|
|
|
qubit_medic/server/__pycache__/openenv_adapter.cpython-312.pyc
CHANGED
|
Binary files a/qubit_medic/server/__pycache__/openenv_adapter.cpython-312.pyc and b/qubit_medic/server/__pycache__/openenv_adapter.cpython-312.pyc differ
|
|
|
qubit_medic/server/__pycache__/rewards.cpython-312.pyc
CHANGED
|
Binary files a/qubit_medic/server/__pycache__/rewards.cpython-312.pyc and b/qubit_medic/server/__pycache__/rewards.cpython-312.pyc differ
|
|
|
qubit_medic/server/app.py
CHANGED
|
@@ -6,8 +6,6 @@ routes (``/reset``, ``/step``, ``/state``, ``/health``, ``/schema``,
|
|
| 6 |
|
| 7 |
We add a few extras on top:
|
| 8 |
|
| 9 |
-
* ``GET /`` - HTML landing page (HF Spaces **App** tab); links to
|
| 10 |
-
``/docs``, ``/healthz``, ``/metadata`` (avoids 404 on the root URL).
|
| 11 |
* ``GET /healthz`` - the Day-0 deployment-substrate liveness probe
|
| 12 |
(returns Stim/PyMatching/openenv versions). Used by the recurring
|
| 13 |
4-hour HF Spaces wakeup ping.
|
|
@@ -26,7 +24,6 @@ import sys
|
|
| 26 |
from typing import Optional
|
| 27 |
|
| 28 |
from fastapi import Body, HTTPException
|
| 29 |
-
from fastapi.responses import HTMLResponse
|
| 30 |
from openenv.core import create_fastapi_app
|
| 31 |
|
| 32 |
from qubit_medic.config import DEFAULT_HOST, DEFAULT_PORT
|
|
@@ -51,10 +48,11 @@ app = create_fastapi_app(
|
|
| 51 |
action_cls=QubitMedicAction,
|
| 52 |
observation_cls=QubitMedicObservation,
|
| 53 |
)
|
| 54 |
-
|
|
|
|
| 55 |
app.version = os.getenv("QUBIT_MEDIC_VERSION", "1.0.0")
|
| 56 |
app.description = (
|
| 57 |
-
"RL training environment for LLM-based quantum error-correction "
|
| 58 |
"decoders. Built on Stim + PyMatching with five independent verifiable "
|
| 59 |
"rewards (logical correction, syndrome consistency, Hamming overlap, "
|
| 60 |
"format compliance, PyMatching beat-rate). Wraps "
|
|
@@ -63,44 +61,6 @@ app.description = (
|
|
| 63 |
)
|
| 64 |
|
| 65 |
|
| 66 |
-
@app.get("/", response_class=HTMLResponse, include_in_schema=False)
|
| 67 |
-
def root() -> str:
|
| 68 |
-
"""Space + browser landing page (HF opens ``/`` in the App tab).
|
| 69 |
-
|
| 70 |
-
The OpenEnv API lives under ``/reset``, ``/step``, etc.; there was no
|
| 71 |
-
root handler, so visitors saw 404. This page links to docs and health.
|
| 72 |
-
"""
|
| 73 |
-
return """<!DOCTYPE html>
|
| 74 |
-
<html lang="en">
|
| 75 |
-
<head>
|
| 76 |
-
<meta charset="utf-8"/>
|
| 77 |
-
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
| 78 |
-
<title>Qubit-Medic OpenEnv</title>
|
| 79 |
-
<style>
|
| 80 |
-
body { font-family: system-ui, sans-serif; max-width: 40rem; margin: 2rem auto; padding: 0 1rem; line-height: 1.5; color: #1e293b; }
|
| 81 |
-
h1 { font-size: 1.5rem; }
|
| 82 |
-
ul { padding-left: 1.2rem; }
|
| 83 |
-
a { color: #2563eb; }
|
| 84 |
-
code { background: #f1f5f9; padding: 0.1em 0.3em; border-radius: 4px; }
|
| 85 |
-
</style>
|
| 86 |
-
</head>
|
| 87 |
-
<body>
|
| 88 |
-
<h1>Qubit-Medic — OpenEnv server</h1>
|
| 89 |
-
<p>This Space exposes a <strong>JSON API</strong> for the quantum error-decoding
|
| 90 |
-
environment (Stim + PyMatching, OpenEnv contract). There is no full-page
|
| 91 |
-
Gradio UI here; use the links below.</p>
|
| 92 |
-
<ul>
|
| 93 |
-
<li><a href="/docs">Interactive API docs (Swagger)</a></li>
|
| 94 |
-
<li><a href="/redoc">ReDoc</a></li>
|
| 95 |
-
<li><a href="/healthz">Liveness <code>GET /healthz</code></a> — versions probe</li>
|
| 96 |
-
<li><a href="/metadata">OpenEnv <code>GET /metadata</code></a></li>
|
| 97 |
-
</ul>
|
| 98 |
-
<p>Typical flow: <code>POST /reset</code> then <code>POST /step</code> with
|
| 99 |
-
the model’s text action — see the schema in <code>/docs</code>.</p>
|
| 100 |
-
</body>
|
| 101 |
-
</html>"""
|
| 102 |
-
|
| 103 |
-
|
| 104 |
# --------------------------------------------------------------------------- #
|
| 105 |
# Day-0 + demo extras #
|
| 106 |
# --------------------------------------------------------------------------- #
|
|
|
|
| 6 |
|
| 7 |
We add a few extras on top:
|
| 8 |
|
|
|
|
|
|
|
| 9 |
* ``GET /healthz`` - the Day-0 deployment-substrate liveness probe
|
| 10 |
(returns Stim/PyMatching/openenv versions). Used by the recurring
|
| 11 |
4-hour HF Spaces wakeup ping.
|
|
|
|
| 24 |
from typing import Optional
|
| 25 |
|
| 26 |
from fastapi import Body, HTTPException
|
|
|
|
| 27 |
from openenv.core import create_fastapi_app
|
| 28 |
|
| 29 |
from qubit_medic.config import DEFAULT_HOST, DEFAULT_PORT
|
|
|
|
| 48 |
action_cls=QubitMedicAction,
|
| 49 |
observation_cls=QubitMedicObservation,
|
| 50 |
)
|
| 51 |
+
# OpenAPI /docs title & description (product name on Swagger only; code paths unchanged).
|
| 52 |
+
app.title = "QuantumScribe"
|
| 53 |
app.version = os.getenv("QUBIT_MEDIC_VERSION", "1.0.0")
|
| 54 |
app.description = (
|
| 55 |
+
"QuantumScribe: RL training environment for LLM-based quantum error-correction "
|
| 56 |
"decoders. Built on Stim + PyMatching with five independent verifiable "
|
| 57 |
"rewards (logical correction, syndrome consistency, Hamming overlap, "
|
| 58 |
"format compliance, PyMatching beat-rate). Wraps "
|
|
|
|
| 61 |
)
|
| 62 |
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
# --------------------------------------------------------------------------- #
|
| 65 |
# Day-0 + demo extras #
|
| 66 |
# --------------------------------------------------------------------------- #
|