gusye1234 / nano-vectordb

A simple, easy-to-hack Vector Database
71 stars 3 forks source link

ValueError bug #2

Closed hxt365 closed 1 month ago

hxt365 commented 1 month ago
  File "/home/miniconda3/envs/py3.10/lib/python3.10/site-packages/nano_vectordb/dbs.py", line 147, in query
    return self.usable_metrics[self.metric](query, top_k, better_than_threshold)
  File "/home/miniconda3/envs/py3.10/lib/python3.10/site-packages/nano_vectordb/dbs.py", line 162, in _cosine_query
    scores = np.dot(use_matrix, query)
ValueError: shapes (42,1536) and (768,) not aligned: 1536 (dim 1) != 768 (dim 0)
gusye1234 commented 1 month ago

I guess you changed the embedding model but used a old storage file.

hxt365 commented 1 month ago

Thanks. I figured it out. I think the error message can be improved