llmware-ai / llmware

Unified framework for building enterprise RAG pipelines with small, specialized models
https://llmware-ai.github.io/llmware/
Apache License 2.0
6.43k stars 1.52k forks source link

Rag 5 Semantic Query (Fast Start throws an error) #989

Open lekejo opened 2 months ago

lekejo commented 2 months ago

Hello, I am new to all of this and I was trying to follow and run the RAG notebooks on google colab. The 5th notebook in the RAG series (Fast Start) when run on colab throws the following error. In fact, you can find the error in the original notebook itself which was uploaded. It seems this notebook never ran well.

update: Step 4 - Generating Embeddings in chomadb db - with Model- industry-bert-contracts

TypeError Traceback (most recent call last) in <cell line: 2>() 1 print("\nupdate: Step 4 - Generating Embeddings in {} db - with Model- {}".format(vector_db, embedding_model)) ----> 2 library.install_new_embedding(embedding_model=embedding_model, vector_db=vector_db)

TypeError: Library.install_new_embedding() got an unexpected keyword argument 'embedding_model'

I hope you see that.

pritesh2000 commented 1 month ago

I had run this file recently but didn't encounter any error. In some cases, rerun would solve problem.

lekejo commented 1 month ago

Hello all, Thanks for replying back. I was able to run the notebook on google collab after removing the "embedding_model=" and "vector_db=". The original notebook (ipynb and not the .py) file seems to have issues. you can find errors in the notebook after the line of code. That's what I want to highlight. See for yourself here:

print("\nupdate: Step 4 - Generating Embeddings in {} db - with Model- {}".format(vector_db, embedding_model))
library.install_new_embedding(embedding_model=embedding_model, vector_db=vector_db)

**update: Step 4 - Generating Embeddings in chomadb db - with Model- industry-bert-contracts
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-13-ddf9472f6b35> in <cell line: 2>()
      1 print("\nupdate: Step 4 - Generating Embeddings in {} db - with Model- {}".format(vector_db, embedding_model))
----> 2 library.install_new_embedding(embedding_model=embedding_model, vector_db=vector_db)

TypeError: Library.install_new_embedding() got an unexpected keyword argument 'embedding_model'**
ahmedsalim3 commented 1 month ago

Hi @lekejo, you're right. It seems there's a typo in the example_5_rag_semantic_query.ipynb notebook.

The issue occurred because the install_new_embedding function in Library class expects the parameter embedding_model_name instead of embedding_model . (see source)

To fix this, you just need to update the keyword argument in the code like so:

library.install_new_embedding(embedding_model_name=embedding_model, vector_db=vector_db)