defog-ai/sql-eval

Error while evaluating Question

csmileykc opened this issue · 3 comments

Hello, Awesome initiative by the way!

I was trying to run this application, and got an error at the point where a question was being evaluated by pruning.py.

File "pruning.py", line 26, in knn
similarity_scores = F.cosine_similarity(query_emb, all_emb)
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)

To debug: print(prune_metadata_str("What are the titles of all publications ordered alphabetically?", "academic"))
I see that the dimensions of the all_emb and query_emb tensors are different:
query_emb.get_shape(): torch.Size([384])
all_emb.get_shape(): torch.Size([42, 384])

Can you please review?

Thanks!

Thanks for opening the issue! That's odd. Will debug

Hi there, I can't seem to replicate this. Could you please share what version of pytorch and sentence_transformers you're using? That will help us debug this better

Thanks for raising – we just fixed it!