Open wbhob opened 1 week ago
I was able to patch this on my local version by flattening the array in rag/nlp/search.py:57-67
def _vector(self, txt, emb_mdl, sim=0.8, topk=10):
qv, c = emb_mdl.encode_queries(txt)
# Ensure qv is a 1-dimensional array
qv_flat = np.array(qv).flatten()
return {
"field": f"q_{len(qv_flat)}_vec",
"k": topk,
"similarity": sim,
"num_candidates": topk * 2,
"query_vector": qv_flat.tolist() # Convert numpy array to list
}
I could run it correctly. The Docker code is behind the code on GitHub, which may be the reason for this error. Or can I take a look at your request operation?
I am sending my request the exact same way. Are you using the Cohere reranker? Not sure if that matters. But yes I was using the docker container, but even after trying to build it from main branch I was having issues
I don't use any rerank model, maybe it's the reason for the problem. I will test it.
Just tried with the latest dev container and v0.13, still having this problem. How do you remove the rerank model? I am using OpenAI for inference but want to turn off reranking for the time being if it is causing problems
Is there an existing issue for the same bug?
Branch name
main
Commit ID
2a614e0
Other environment information
Actual behavior
Attempting to use /retrieval results in
TypeError: only length-1 arrays can be converted to Python scalars
. I am providing onlyquestion
,datasets
, anddocuments
. I added debug logs and got the following stack trace below.Expected behavior
Expected results of query. Everything is showing as ingested successfully.
Steps to reproduce
Additional information