ai-rag / scripts /patch_chromadb_numpy2.py
robrtt's picture
Clean rebuild: all features fixed
5da7941
raw
history blame contribute delete
589 Bytes
"""Patch chromadb 0.5.3 untuk kompatibilitas numpy 2.x."""
import pathlib, sys
p = pathlib.Path('/usr/local/lib/python3.10/site-packages/chromadb/api/types.py')
if not p.exists():
print("[patch] chromadb/api/types.py tidak ditemukan, skip")
sys.exit(0)
txt = p.read_text()
if 'np.float64' in txt and 'np.float_' not in txt:
print("[patch] sudah di-patch, skip")
sys.exit(0)
txt = txt.replace(
'np.uint, np.int_, np.float_',
'np.unsignedinteger, np.signedinteger, np.float64'
)
p.write_text(txt)
print(f"[patch] chromadb/api/types.py patched for numpy 2.x: {p}")