[BUG]: ovl.py verify --weights crashes with AttributeError on checkpoint .pt files
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend, machine-learning
Research direction
Read load_weights() and cmd_verify in simple/ovl.py (the issue identifies lines 579–585 and 655–657). Check how the loaded object is passed to model_digest, then run the CPU reproduction from the issue with a checkpoint and an empty dict. Done when invalid inputs exit cleanly with is not a model state dict and valid model state dicts still verify.
Written by the indexing model from the issue text.
Description
Summary
In simple/ovl.py, load_weights() returns the raw object loaded by torch.load(..., weights_only=True) (or safetensors.torch.load_file(...)) without verifying that it is a non-empty state dict of tensors.
Passing a training checkpoint (e.g., ckpt-00001.pt, which is {"control": ..., "model": ..., "opt": ...}) or an empty dict to ovl.py verify --weights passes straight into model_digest(sd) and crashes with an unhandled AttributeError: 'dict' object has no attribute 'detach' (or returns a bogus digest for {}).
Source
simple/ovl.py(load_weights, lines 579–585;cmd_verify, lines 655–657)
Reproduction (CPU)
import hashlib, json, os, subprocess, sys, tempfile
from pathlib import Path
import torch
with tempfile.TemporaryDirectory() as tmp:
d = Path(tmp)
e0 = {"index": 0, "kind": "initial", "state": "0" * 64, "model": "0" * 64, "previous": None}
h0 = hashlib.sha256(json.dumps(e0, sort_keys=True).encode()).hexdigest()
e1 = {"index": 1, "kind": "final", "state": "1" * 64, "model": "1" * 64, "previous": h0}
(d / "chain.jsonl").write_text(json.dumps(e0) + "\n" + json.dumps(e1) + "\n")
ckpt = d / "ckpt-00001.pt"
torch.save({"control": {"phase": "wikipedia"}, "model": {"w": torch.zeros(2)}, "opt": {}}, ckpt)
res = subprocess.run(
[sys.executable, "simple/ovl.py", "verify", "--run", str(d), "--no-anchor", "--weights", str(ckpt)],
capture_output=True, text=True, env={**os.environ, "OVL_DEVICE": "cpu"},
)
print("rc:", res.returncode)
print(res.stderr)
Expected Behavior
load_weights() should validate that the loaded object is a non-empty dict whose values are all tensors, and exit cleanly with is not a model state dict otherwise.
- Dominant language
- Python
- Stars
- 27
- Forks
- 72
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 45
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AOSSIE-Org/OpenVerifiableLLM
-
[BUG]: verify_segment accepts empty, wrong-phase, or non-positive fork exclusions as MATCHPossibly taken @Arnav0107 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
AOSSIE-Org/OpenVerifiableLLM#385 · 3 comments ·
Maintainers usually reply within 1 day
-
[BUG]: preparation.lock install fails on macOSPossibly taken @darshith2527-sketch claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
AOSSIE-Org/OpenVerifiableLLM#357 · 3 comments ·
Maintainers usually reply within 1 day
-
[BUG]: Forked runs omit timestamps for inherited chain entriesPossibly taken @pavithra-r06 claimed this 9 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
AOSSIE-Org/OpenVerifiableLLM#334 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
[BUG]: review_ckpt.py passes a run that has .pt files no chain entry coversPossibly taken @arshil42 claimed this 9 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
AOSSIE-Org/OpenVerifiableLLM#332 · 4 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
[BUG]: DigiCert timestamp verification fails on Windows because system_ca() ignores Windows CA bundlesPossibly taken @pavithra-r06 claimed this 9 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
AOSSIE-Org/OpenVerifiableLLM#290 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
All issues in AOSSIE-Org/OpenVerifiableLLM
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
bad-antics/lateralus-lang#1140 ·
Maintainers usually reply within 4 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 3 days
-
fixture good first issue help wanted vendor:cisco
Difficulty 1/5 1-3 hours Newbie friendliness 85/100