release: v0.5.15 — fix cache regression and structural cleanup
- cache.py: fix np.save extension bug from v0.5.13 — tmp path used final+".tmp" (abc.npy.tmp) but np.save auto-appends .npy to paths not ending in .npy, writing to abc.npy.tmp.npy instead; os.replace then raised FileNotFoundError silently, making every cache write a no-op and leaking *.npy.tmp.npy files. Fixed by inserting .tmp before .npy: tmp = final[:-4] + ".tmp.npy" - config.py: remove str(default) round-trip in _getenv_int/_getenv_float — use raw = os.getenv(name); return default if raw is None else int(raw) so a future float default can't cause a spurious "not a valid integer" warning and return the wrong type - executor.py: consolidate 4 progress.remove_task calls into one try/finally around the per-job body; continue inside try/finally executes the finally before the next iteration, making the invariant structurally enforced rather than relying on discipline across 4 sites
This commit is contained in:
+3
-1
@@ -83,7 +83,9 @@ class EmbeddingCache:
|
||||
"""Store an embedding in the cache."""
|
||||
self._ensure_dir()
|
||||
final = self._path(asset_id, model)
|
||||
tmp = final + ".tmp"
|
||||
# Insert .tmp before .npy so np.save doesn't auto-append another .npy extension
|
||||
# (np.save appends .npy to paths that don't already end in .npy).
|
||||
tmp = final[:-4] + ".tmp.npy"
|
||||
try:
|
||||
np.save(tmp, embedding)
|
||||
os.replace(tmp, final)
|
||||
|
||||
Reference in New Issue
Block a user