amazon-bedrock-workshop icon indicating copy to clipboard operation
amazon-bedrock-workshop copied to clipboard

'BedrockEmbeddings' object is not callable

Open haiderghaleb opened this issue 1 year ago • 3 comments

Hey everyone,

I'm facing issues while running 01_qa_w_rag_claude.ipynb, everything is configured correcting and running until the step of

query_embedding = vectorstore_faiss.embedding_function(query)
np.array(query_embedding)

when I run it, I get the below error:

[amazon-bedrock-workshop/03_QuestionAnswering/01_qa_w_rag_claude.ipynb] Cell 22 line 1
----> [1](amazon-bedrock-workshop/03_QuestionAnswering/01_qa_w_rag_claude.ipynb#X30sZmlsZQ%3D%3D?line=0) query_embedding = vectorstore_faiss.embedding_function(query)
      [2](amazon-bedrock-workshop/03_QuestionAnswering/01_qa_w_rag_claude.ipynb#X30sZmlsZQ%3D%3D?line=1) np.array(query_embedding)

TypeError: 'BedrockEmbeddings' object is not callable

I tried to see how to fix the issue, but there was no solution.

Does anyone know how to fix this issue?

haiderghaleb avatar Nov 19 '23 01:11 haiderghaleb

I changed the code to the following and it worked. query_embedding = vectorstore_faiss.embedding_function.embed_query(query)

BehnooshParsa avatar Nov 20 '23 07:11 BehnooshParsa

@BehnooshParsa could you please raise a PR for the fix

rsgrewal-aws avatar Dec 15 '23 17:12 rsgrewal-aws

PR https://github.com/aws-samples/amazon-bedrock-workshop/pull/156

egor-miasnikov avatar Dec 20 '23 16:12 egor-miasnikov

Closing this; please refer to the latest bedrock workshop update and reopen if still relevant

w601sxs avatar Apr 09 '24 20:04 w601sxs