Context
using two time the same work_dir lead to error
from docarray import DocList
from docarray.documents import ImageDoc
from docarray.index import HnswDocumentIndex
import numpy as np
# create some data
dl = DocList[ImageDoc](
[
ImageDoc(
url="https://upload.wikimedia.org/wikipedia/commons/2/2f/Alpamayo.jpg",
tensor=np.zeros((3, 224, 224)),
embedding=np.random.random((128,)),
)
for _ in range(100)
]
)
# create a Document Index
index = HnswDocumentIndex[ImageDoc](work_dir='/tmp/test_index2')
index = HnswDocumentIndex[ImageDoc](work_dir='/tmp/test_index2') # second time is failing
Context
using two time the same
work_dirlead to error