jubba-io commited on
Commit
1de23ea
·
verified ·
1 Parent(s): a7727c4

Reject unsupported event loops before dispatch and document pinned downloads

Browse files
Files changed (5) hide show
  1. README.md +5 -2
  2. SHA256SUMS +4 -4
  3. VALIDATION.md +4 -1
  4. artifact_manifest.json +3 -3
  5. run_sampling.py +6 -0
README.md CHANGED
@@ -40,10 +40,11 @@ as calibrated correctness probabilities.
40
  ## Download and run
41
 
42
  Use Python 3.12 (validated environment); pinned PyTorch 2.8.0 and Transformers
43
- 4.57.1. Download this repository with `hf download` or `snapshot_download`:
 
 
44
 
45
  ```bash
46
- hf download OVRLab/granite-jev-1b-sampling --local-dir granite-jev-sampling
47
  cd granite-jev-sampling
48
  python -m venv .venv
49
  . .venv/bin/activate
@@ -102,6 +103,8 @@ draw, not best-of-three. Outputs are capped at 2,048 tokens per branch and total
102
  context at 32,768 tokens. The default output cap is 1,024. `--max-seconds` is a
103
  bounded request deadline. One runner owns one serial request; no generated code
104
  is executed. A user prompt is sent to Jev only on disagreement.
 
 
105
 
106
  ## Evidence and reproducibility
107
 
 
40
  ## Download and run
41
 
42
  Use Python 3.12 (validated environment); pinned PyTorch 2.8.0 and Transformers
43
+ 4.57.1. First use the
44
+ [version-pinned download instructions](https://github.com/OVRLab/jev-guided-decoding/blob/main/releases/granite-jev-1b-sampling/INSTALL.md),
45
+ which give the exact verified Hugging Face commit. Then:
46
 
47
  ```bash
 
48
  cd granite-jev-sampling
49
  python -m venv .venv
50
  . .venv/bin/activate
 
103
  context at 32,768 tokens. The default output cap is 1,024. `--max-seconds` is a
104
  bounded request deadline. One runner owns one serial request; no generated code
105
  is executed. A user prompt is sent to Jev only on disagreement.
106
+ The API is synchronous: invoke it outside a running asyncio event loop. An
107
+ event-loop rejection happens before provider dispatch and records zero API attempts.
108
 
109
  ## Evidence and reproducibility
110
 
SHA256SUMS CHANGED
@@ -1,15 +1,15 @@
1
  c758d4f7878f1d7bc304c083b9fe1a7392933e5cd7fc9fe641f266c14c93978b LICENSE
2
  9536fa2f6c4051093a1b1126ffaaee528d2a5324f12f15fd6cba9a5a9b0b99cc NOTICE.md
3
- 91074e031b26bb7df9dca436c850c3bbbde6df741d52c7d794bd6f25a1db9e36 README.md
4
  0975fa492a2b9b059963e731cd34ac81be7d3790eb77d6479b188c3dbc7650f2 SECURITY.md
5
- 136f0f37ed5d50d6a5f691f0779f6a22b80131f2468e451bb0323a10359840fc VALIDATION.md
6
  e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 _client/__init__.py
7
  a7064bab80e28d633f99d2c8fabf2deb8c5f024b4540c388b5b02e474df1f84d _client/jev.py
8
  20e5af7f3f5c65e9e6293a949693f503e54eccc1c9ebade4d6cef0b2639650b1 _client/types.py
9
- 5b8629605f598d1c8c20dc6960dfd1439cd0c410e78714c68634eabcb23ecde9 artifact_manifest.json
10
  41183c6e3b669411f3bd24de7282509cf8d484021dbc1cc62c305c1a53f28603 example.json
11
  d4351148fcc569c924a11d3c0a24f5fb14381ad6cce960ed74a4e6f555301bda requirements.txt
12
- b6099ebc311080c5a4671e6b3d7a6c4af05d264768660d750717ce92035049ae run_sampling.py
13
  d5406658669edab3123fec1dd0f3f0a45d1b656903cc7f0a91da0350602bd495 runtime.py
14
  1ff430aba1a3cd4a194cdfb278701457c963bee33dc66137fd7b024b56007bfe source_manifest.json
15
  4040a30deafa507e87151e813800d172991939a69e8633e35883d4abc8a9993c validation/release-e2e.json
 
1
  c758d4f7878f1d7bc304c083b9fe1a7392933e5cd7fc9fe641f266c14c93978b LICENSE
2
  9536fa2f6c4051093a1b1126ffaaee528d2a5324f12f15fd6cba9a5a9b0b99cc NOTICE.md
3
+ 034aa44c338153b02cedce3765e14dd79be0d9820386be5f4bff6025bea6c5fc README.md
4
  0975fa492a2b9b059963e731cd34ac81be7d3790eb77d6479b188c3dbc7650f2 SECURITY.md
5
+ b9f7ebe7befcee58a4eb82dfe786e4603e08e0246425ed51bb99d7715d5939e9 VALIDATION.md
6
  e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 _client/__init__.py
7
  a7064bab80e28d633f99d2c8fabf2deb8c5f024b4540c388b5b02e474df1f84d _client/jev.py
8
  20e5af7f3f5c65e9e6293a949693f503e54eccc1c9ebade4d6cef0b2639650b1 _client/types.py
9
+ 6f120c9afbe5d8d03faad511c113780121f3d8de67874a252dd0f8f80ee0b12a artifact_manifest.json
10
  41183c6e3b669411f3bd24de7282509cf8d484021dbc1cc62c305c1a53f28603 example.json
11
  d4351148fcc569c924a11d3c0a24f5fb14381ad6cce960ed74a4e6f555301bda requirements.txt
12
+ 420f045e6f112186fdfbf338329cd08367c54828a32dee77770f966d1908d2a1 run_sampling.py
13
  d5406658669edab3123fec1dd0f3f0a45d1b656903cc7f0a91da0350602bd495 runtime.py
14
  1ff430aba1a3cd4a194cdfb278701457c963bee33dc66137fd7b024b56007bfe source_manifest.json
15
  4040a30deafa507e87151e813800d172991939a69e8633e35883d4abc8a9993c validation/release-e2e.json
VALIDATION.md CHANGED
@@ -8,7 +8,7 @@ recorded for the exact Hugging Face revision in the source repository's
8
  - Capability tests first failed on Azure because the new runner did not exist.
9
  - Offline tests cover reference isolation, exact token ownership, agreement,
10
  strict margin, invalid scores/version, absent credentials and provider failure.
11
- - Forty-four targeted tests passed on Azure, including tiny-model sampled/greedy
12
  parity, unchanged weights/private RNG, cache/context checks, credential-free
13
  native mode, single-attempt transport, redirect rejection and artifact tampering.
14
  - A review regression first exposed missing task/rubric provenance; saved native,
@@ -37,6 +37,9 @@ recorded for the exact Hugging Face revision in the source repository's
37
  - Seven hook-scope regressions initially admitted active model, backbone, nested
38
  module or pre-forward hooks; admission now checks both hook types throughout
39
  the module tree. Eight hook cases pass, including removal/restored admission.
 
 
 
40
  - The initial full source-repository suite passed 1,083 tests on Azure; documentation,
41
  lint, formatting and package-build checks passed. Initial failures in a tar-only
42
  checkout were traced to missing Git metadata; the complete suite was rerun in
 
8
  - Capability tests first failed on Azure because the new runner did not exist.
9
  - Offline tests cover reference isolation, exact token ownership, agreement,
10
  strict margin, invalid scores/version, absent credentials and provider failure.
11
+ - Forty-five targeted tests passed on Azure, including tiny-model sampled/greedy
12
  parity, unchanged weights/private RNG, cache/context checks, credential-free
13
  native mode, single-attempt transport, redirect rejection and artifact tampering.
14
  - A review regression first exposed missing task/rubric provenance; saved native,
 
37
  - Seven hook-scope regressions initially admitted active model, backbone, nested
38
  module or pre-forward hooks; admission now checks both hook types throughout
39
  the module tree. Eight hook cases pass, including removal/restored admission.
40
+ - An event-loop regression first produced an unaccounted pre-dispatch exception;
41
+ the synchronous API now rejects that context before creating a coroutine and
42
+ records zero attempts with no unknown provider charge.
43
  - The initial full source-repository suite passed 1,083 tests on Azure; documentation,
44
  lint, formatting and package-build checks passed. Initial failures in a tar-only
45
  checkout were traced to missing Git metadata; the complete suite was rerun in
artifact_manifest.json CHANGED
@@ -6,19 +6,19 @@
6
  "verifier": "jev-1.13.0",
7
  "new_weights": false,
8
  "files": {
9
- "run_sampling.py": "b6099ebc311080c5a4671e6b3d7a6c4af05d264768660d750717ce92035049ae",
10
  "runtime.py": "d5406658669edab3123fec1dd0f3f0a45d1b656903cc7f0a91da0350602bd495",
11
  "requirements.txt": "d4351148fcc569c924a11d3c0a24f5fb14381ad6cce960ed74a4e6f555301bda",
12
  "source_manifest.json": "1ff430aba1a3cd4a194cdfb278701457c963bee33dc66137fd7b024b56007bfe",
13
  "_client/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
14
  "_client/jev.py": "a7064bab80e28d633f99d2c8fabf2deb8c5f024b4540c388b5b02e474df1f84d",
15
  "_client/types.py": "20e5af7f3f5c65e9e6293a949693f503e54eccc1c9ebade4d6cef0b2639650b1",
16
- "README.md": "91074e031b26bb7df9dca436c850c3bbbde6df741d52c7d794bd6f25a1db9e36",
17
  "NOTICE.md": "9536fa2f6c4051093a1b1126ffaaee528d2a5324f12f15fd6cba9a5a9b0b99cc",
18
  "SECURITY.md": "0975fa492a2b9b059963e731cd34ac81be7d3790eb77d6479b188c3dbc7650f2",
19
  "LICENSE": "c758d4f7878f1d7bc304c083b9fe1a7392933e5cd7fc9fe641f266c14c93978b",
20
  "example.json": "41183c6e3b669411f3bd24de7282509cf8d484021dbc1cc62c305c1a53f28603",
21
- "VALIDATION.md": "136f0f37ed5d50d6a5f691f0779f6a22b80131f2468e451bb0323a10359840fc",
22
  "validation/release-smoke.json": "e632a7df8125c6a5c1047a8e1443588c699fff79c05542b06e5dc6db9aeadd24",
23
  "validation/release-e2e.json": "4040a30deafa507e87151e813800d172991939a69e8633e35883d4abc8a9993c"
24
  }
 
6
  "verifier": "jev-1.13.0",
7
  "new_weights": false,
8
  "files": {
9
+ "run_sampling.py": "420f045e6f112186fdfbf338329cd08367c54828a32dee77770f966d1908d2a1",
10
  "runtime.py": "d5406658669edab3123fec1dd0f3f0a45d1b656903cc7f0a91da0350602bd495",
11
  "requirements.txt": "d4351148fcc569c924a11d3c0a24f5fb14381ad6cce960ed74a4e6f555301bda",
12
  "source_manifest.json": "1ff430aba1a3cd4a194cdfb278701457c963bee33dc66137fd7b024b56007bfe",
13
  "_client/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
14
  "_client/jev.py": "a7064bab80e28d633f99d2c8fabf2deb8c5f024b4540c388b5b02e474df1f84d",
15
  "_client/types.py": "20e5af7f3f5c65e9e6293a949693f503e54eccc1c9ebade4d6cef0b2639650b1",
16
+ "README.md": "034aa44c338153b02cedce3765e14dd79be0d9820386be5f4bff6025bea6c5fc",
17
  "NOTICE.md": "9536fa2f6c4051093a1b1126ffaaee528d2a5324f12f15fd6cba9a5a9b0b99cc",
18
  "SECURITY.md": "0975fa492a2b9b059963e731cd34ac81be7d3790eb77d6479b188c3dbc7650f2",
19
  "LICENSE": "c758d4f7878f1d7bc304c083b9fe1a7392933e5cd7fc9fe641f266c14c93978b",
20
  "example.json": "41183c6e3b669411f3bd24de7282509cf8d484021dbc1cc62c305c1a53f28603",
21
+ "VALIDATION.md": "b9f7ebe7befcee58a4eb82dfe786e4603e08e0246425ed51bb99d7715d5939e9",
22
  "validation/release-smoke.json": "e632a7df8125c6a5c1047a8e1443588c699fff79c05542b06e5dc6db9aeadd24",
23
  "validation/release-e2e.json": "4040a30deafa507e87151e813800d172991939a69e8633e35883d4abc8a9993c"
24
  }
run_sampling.py CHANGED
@@ -207,6 +207,12 @@ def mark_no_dispatch(exc):
207
 
208
  def call_jev(payload, *, key_file=None, timeout=90):
209
  try:
 
 
 
 
 
 
210
  c = client()
211
  key = c.load_api_key(key_file)
212
  if type(timeout) not in (int, float) or not math.isfinite(timeout) or timeout <= 0:
 
207
 
208
  def call_jev(payload, *, key_file=None, timeout=90):
209
  try:
210
+ try:
211
+ asyncio.get_running_loop()
212
+ except RuntimeError:
213
+ pass
214
+ else:
215
+ raise RuntimeError("Call this synchronous runner outside a running event loop")
216
  c = client()
217
  key = c.load_api_key(key_file)
218
  if type(timeout) not in (int, float) or not math.isfinite(timeout) or timeout <= 0: