Harden MollyGraph smoke and relation cleanup#1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff5ade1bf6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| cached = try_to_load_from_cache(model_ref, "model.safetensors") | ||
| if isinstance(cached, str) and Path(cached).exists(): | ||
| return |
There was a problem hiding this comment.
Enforce no-download mode for full model snapshot
When MOLLYGRAPH_ALLOW_MODEL_DOWNLOADS=0, this check treats the model as "offline-ready" if only model.safetensors is cached, but GLiNER2.from_pretrained(model_ref) is still called without any offline/local-only guard. On a clean machine with partial cache, GLiNER2 can still need other Hub files (e.g. config/tokenizer), so the runtime either performs network downloads despite the flag or fails unexpectedly in offline environments.
Useful? React with 👍 / 👎.
|
|
||
| if real_models: | ||
| if not allow_model_downloads: | ||
| env.setdefault("MOLLYGRAPH_ALLOW_MODEL_DOWNLOADS", "0") |
There was a problem hiding this comment.
Make --real-models default truly disable downloads
Using env.setdefault("MOLLYGRAPH_ALLOW_MODEL_DOWNLOADS", "0") means --real-models does not actually enforce the default no-download behavior when the parent shell already exports MOLLYGRAPH_ALLOW_MODEL_DOWNLOADS=1. In that case, downloads stay enabled even without --allow-model-downloads, so the CLI flag semantics are inconsistent and can bypass the intended safety default.
Useful? React with 👍 / 👎.
Summary
Verification
Linear
Closes REC-183, REC-184, REC-185, REC-190, REC-191, REC-210.
REC-201 remains backlog for separate training-state hardening.