You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When constructing a basic hybrid router, and then calling it the error "Index is not ready" is thrown. My initial code was as follows:
encoder = HuggingFaceEncoder()
sparse_encoder = BM25Encoder()
index = HybridLocalIndex()
rl = HybridRouter(encoder=encoder, sparse_encoder=sparse_encoder, routes=routes, index=index)
print(rl("Get me an image of ships in the bay"))
After reading through the code and finding the is_ready() function, as well as looking through the index.add() function, I then attempted:
for route in routes:
index.add(embeddings=encoder(route.utterances), routes=[route.name], utterances=route.utterances, sparse_embeddings=sparse_encoder(route.utterances))
print(route.utterances)
print(index.get_routes())
This, however, both threw IndexError: index 41 is out of bounds for axis 0 with size 4, and only added the first utterance to the list of utterances.
It is very possible that I am missing something obvious, but I would appreciate some guidance on how to move forward.
Thanks in advance!
The text was updated successfully, but these errors were encountered:
When constructing a basic hybrid router, and then calling it the error "Index is not ready" is thrown. My initial code was as follows:
After reading through the code and finding the
is_ready()
function, as well as looking through theindex.add()
function, I then attempted:This, however, both threw
IndexError: index 41 is out of bounds for axis 0 with size 4
, and only added the first utterance to the list of utterances.It is very possible that I am missing something obvious, but I would appreciate some guidance on how to move forward.
Thanks in advance!
The text was updated successfully, but these errors were encountered: