Chainlit / chainlit

Build Conversational AI in minutes ⚡️
https://docs.chainlit.io
Apache License 2.0
6.78k stars 882 forks source link

Issue upgrading from 0.6.3 to 0.7.0 #432

Closed pine-conez closed 11 months ago

pine-conez commented 11 months ago

Hello! I tried upgrading chainlit, and when I run queries I receive TypeError: 'NoneType' object is not a mapping. I've traced it to https://github.com/Chainlit/chainlit/blob/aae67be728de3ebdf86e0f9ea010ae19eef9fb03/backend/chainlit/langchain/callbacks.py#L26 It seems that invocation_params.pop["model_kwargs"] == None in my case, which later results in the error. I'm not sure why model_kwargs is None, but since 0.6.3 worked for me I didn't dig in too deep into it (although I did follow the tips in the docs on migrating to 0.7.0 and didn't find a resolution there). I fixed it by adding something like

if model_kwargs is None:
  model_kwargs = {}

to callbacks.py. background: using RetrievalQA.from_chain_type with a local llm.

willydouhard commented 11 months ago

Should be fixed with the 0.7.1 version.