AIAnytime / Llama2-Medical-Chatbot

This is a medical bot built using Llama2 and Sentence Transformers. The bot is powered by Langchain and Chainlit. The bot runs on a decent CPU machine with a minimum of 16GB of RAM.
MIT License
296 stars 218 forks source link

extra fields not permitted (type=value_error.extra) when running the model code #1

Closed leandroni closed 1 year ago

leandroni commented 1 year ago

Hi,

Thanks for sharing!

When running the code, I get the following error:

File "/venv/lib/python3.11/site-packages/langchain/load/serializable.py", line 74, in __init__ super().__init__(**kwargs) File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__ pydantic.error_wrappers.ValidationError: 1 validation error for RetrievalQA return_source_document extra fields not permitted (type=value_error.extra)

Im using langchain-0.0.240 and pedantic-1.10.11

Seems to be related to the return_source_document = True in RetrievalQA.from_chain_type. When I comment this argument it works without issue.

leandroni commented 1 year ago

Figured out it was a typo in the return_source_document -> return_source_documents!